Sunday, 12 July 2015

Salesforce javascript get lookup field id

In JavaScript Button we can get the look up field Id with out using query.




var conid= '{!Opportunity.ContactId__c}';
var con_Name = '{!Opportunity.Contact__c}';

Field definition:

Contact      Contact__c     Lookup(Contact)