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
steph1sourcesteph1source 

Custom lookup relationships

When a custom lookup relationship is created is the Id of the record chosen in the lookup available for use in an scontrol? For example, on our custom object Quote I have a lookup relationship called System Administrator which does a lookup to Contact. I wanted to use a S-Control to pull in additional information about the Contact chosen in this field but I do not seem to be able to access the Id so that I can retrieve more info. Any ideas how I could do this? in the case of my example The System_Administrator__c lookup field just contains that name of the Contact not the ID.

thanks for your help!

Ron HessRon Hess
I think if you look at the page source for the page that holds the lookup  relationship you will see the ID, the database stores the ID not the name, the field you are seeing in the detail page and edit page is just the name.

so, in your scontrol System_Administrator__c should be an ID not a name string.
steph1sourcesteph1source

I actually figured out how to get the Id. At first I was trying

var sadmin = "{!SFDC_520_Quote__c.System_Adminstrator__c}";

This returned the name of the contact.

So I tried to get the value through sforceClient.Query and that returned the Id I needed.

 

 

 

LukdanLukdan
Hi steph1source,

I wonder if you can offer some advice. I have a lookup field in an opportunity to a custom object.

Construction_Appointment_Request__c

I see the name of the custom object in the opportunity field, but in reality it is a hyperlink with the ID to the actual record. Is there any way that I can I transform the ID to the text of the actual name of the custom object so that I can use data validation in the opportunity against the name? Is there a slick way to do this in a formula?