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
Donald HurseyDonald Hursey 

Javascript equivalent to url += '&CF00NG0000008ODGm_lkid=' + '{!account.Id}';

I have the following button that was being used for classic. I have a script that can replace it. I'm missing how to reference the id for the masterdetail of the record where the button is located.

How do I pass the Id for the related account similar to the way it was done in the url?

classic:
url += '&CF00NG0000008ODGm=' + '{!account.Name}'.replace(regex2, "");
url += '&CF00NG0000008ODGm_lkid=' + '{!account.Id}';
url += '&00NG0000008ODGn=' + '{!account.BillingStreet}'.replace(regex, "");

Javascript

var leaseLoc = {};
            leaseLoc ['Agreement__c'] = '{!Related_Agreement__c.Id}'; 
            if('{!account}' != ''){
                
                leaseLoc ['Account__c'] = '{!account.Id}';
                leaseLoc ['Address__c'] = '{!account.BillingStreet}';