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
ShuchiMShuchiM 

Lookup field record Id

Hi all

 

I have created a lookup field in a repeat block. I want to get the value of the lookup in jQuey. When i try to do that, I get the value of the record instead of the Id. E.g. if Bill_To__c is my lookup field for account, I get "Test Account" back and not the id of the record in the value. How do i get the id of the record back in jquery?

 

Please advice.

 

Regards

Shuchi

Best Answer chosen by Admin (Salesforce Developers) 
ShuchiMShuchiM

I finally got it working. There is a hidden field that carries the values for lookup field ids. Checked the element structure in Chrome javascript console.

All Answers

ClintLeeClintLee

You should be able to use Bill_To__r.Id to access the Id.  

 

~ Clint

ShuchiMShuchiM

I finally got it working. There is a hidden field that carries the values for lookup field ids. Checked the element structure in Chrome javascript console.

This was selected as the best answer