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
Vincent FruchierVincent Fruchier 

problem with a relationship account field

Hello,

I have a problem regarding a relationship relationship fields on my salesforces organization.

Let me explain, we have created an ambassador program, I need to know who is the ambassador of my opportunity.
I create a field: Ambassador__c of type Reference (Account).

The problem is I want to return the account id in this field
Account ID: 0015800000nv9a8 and not the account name, how should I proceed?

Thank you in advance for your answers.
 
Best Answer chosen by Vincent Fruchier
Jolly_BirdiJolly_Birdi
Hello @Vincent Fruchier

If you want to get the Id in the Developer Console then you will get it by Ambassador__r.Id, 
Else If you want to show the id in the layout then you need to add the text field instead of Reference (Account).

Thanks,
Jolly Birdi

Please mark this as best answer if you find it positive.