3

I need to create formula field that populate full URL of FullPhotoUrl in User object.Currently the value of FullPhotoURL is'/profilephoto/729n00000004DSL/F' where I cannot use for my third party application.It required full url from http: .The full url that required is : https://mycompany--test.cs30.my.salesforce.com/profilephoto/729n00000004DSL/F'

The issue that I faced is I cannot use FullPhotoURL in formula field, it prompt 'invalid field' error.I think it is due to System field cannot be use in Formula field.

I am thinking about update it using trigger but User object is common object whereby it already have a lot of trigger plus I need to update the existing data to fire trigger .Is there any other way beside using trigger?

  • First of all, its not true that standard fields are not available in formula fields. Some are available, well not all. Next, which version of API are you using? I am using 32.0 and my FullPhotoUrl holds the full value including http protocol. Next again, the field is neither available in formula fields nor in workflow field updates. So Trigger is your way out. – Santanu Halder Apr 30 '15 at 6:26
  • When you mentioned version 32.0 , are you refering to file version or object version because when I retrieve using Execute Query in Developer console it still not showing full url? – unidha Apr 30 '15 at 6:34
  • Its object version and even in my Developer Console, its showing full URL. Try querying in Workbench with different versions. – Santanu Halder Apr 30 '15 at 6:43
  • I am using 32 version but only display '/profilephoto/729n00000004DSL/F' instead of 'mycompany--test.cs30.my.salesforce.com/profilephoto/…' – unidha Apr 30 '15 at 7:25
  • Not sure why that's happening. I hope Chatter is enabled in your org. Writing an possible solution to this problem as an Answer. – Santanu Halder Apr 30 '15 at 13:21
0

One workaround would be to use URL.getSalesforceBaseUrl().toExternalForm() which will return the base URL and append the FullPhotoUrl value to it and save it in another custom field. Implement this logic in a Insert/Update trigger of User object.

And for your existing records, implement an Utility class to concatenate and update the custom field and call it once.

| improve this answer | |
  • Thanks for you suggestion,but in our case we are not advisable to create trigger because User object is highly used everywhere and some other procedure applied.I raised case to Salesforce and once I get the info I will share here. – unidha May 14 '15 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.