function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kris WeixelKris Weixel 

Displaying the text value of a lookup field instead of the record id

Hi,

I am trying to get the text value of a lookup field instead of the record id.  I have a patient record that has an insurance provider field, which is a look-up field for any records that have an insurance provider record type.  I'm trying to pull this field over to a second object which is for patient events (sessions).  On my patient event object, i use this formula:   

PPT2__Patient__r.PPT2__Insurance_Provider__c

This formula displays the record id for the insurance provider, not the actual name of the insurance provider.    I know my answer has to deal with the formatting of this, but i can't figure it out.  Any help is greatly appreciated!!!!

Thanks much!
Best Answer chosen by Kris Weixel
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Try this instead:
 
PPT2__Patient__r.PPT2__Insurance_Provider__r.Name

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.

All Answers

Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Try this instead:
 
PPT2__Patient__r.PPT2__Insurance_Provider__r.Name

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
This was selected as the best answer
Kris WeixelKris Weixel
Hi Zuinglio,
Thank you so much for your quick response!  I think you're onto something because I'm seeing something different now.  Now when I save, i see:

 You have reached the maximum number of 10 object references on Patient EventYou must remove at least 1 relationship(s) in order to save this Formula Field.
Related objects referenced in this Formula Field:PPT2__Patient__r
PPT2__Patient__r.PPT2__Insurance_Provider__r[Show Section] Hide References

There are like 20 different object references on patient event, but I didn't create them - they were created by the developers of my application.  Do you know if i can increase this number somewhere?  If not, I will mark this as solved and check with them...

Thank you!
Kris
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello Kris,

You should consider reviewing your Objects relationships. Please refer to this article:
https://help.salesforce.com/HTViewSolution?id=000006372&language=en_US (https://help.salesforce.com/HTViewSolution?id=000006372&language=en_US" target="_blank)

You can increase the number but I think you have to open a Case in Salesforce support:
https://help.salesforce.com/apex/HTViewSolution?urlname=Can-the-limit-of-spanning-relationships-be-increased&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=Can-the-limit-of-spanning-relationships-be-increased&language=en_US" target="_blank)

Hope to have helped.

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
Kris WeixelKris Weixel
This is great.  Thank you so much for your help!