Skip to main content
Hi,

kindly have a look of button number 1 which calls button number2 and i need to pass id from button 1 to button 2.

Button 1:

{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}

{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}

var id= '{!Account.Id}';

var ids = sforce.apex.execute('CreateContract','CreateRecord',{recId :id});

alert(ids);

function openConga(){

window.open('{!URLFOR($Action.Contract.CreatesContracts, Contract.Id)}','_blank');

}

window.open(openConga());

button 2  (name=createscontracts):

/apex/APXTConga4__Conga_Composer

?serverUrl={!API.Partner_Server_URL_370}

&id={!Contract.Id}

&TemplateId=a0M1w000001uSspEAE

&SC0=1

&SC1=Attachments

&AttachmentParentID={!Contract.Id}

while calling the button number 2, it shows the id null in conga url for (contract.Id). 

could you please assist me, how can i pass id from first javascript button to another one and can get the value for contract.id in conga url.

I shall be grateful to you for your kind assistance.

Thanks and regards
3 risposte
  1. 3 giu 2021, 09:26
    I simply wrote the method of button number 2 in button number 1. i took the id from button number 1 and called the conga url just after that. like this

    {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}

    {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}

    var id= '{!Account.Id}';

    var ids = sforce.apex.execute('CreateContract','CreateRecord',{recId :id});

    var str = ids;

    window.location.href = '/apex/APXTConga4__Conga_Composer?serverUrl={!API.Partner_Server_URL_370}&id='+str+'&TemplateId=a0M1w000001uSspEAE&SC0=1&SC1=Attachments&AttachmentParentID='+str
0/9000