You need to sign in to do that
Don't have an account?
nishant shrivastava 40
Passing parameter from one Javascript button to another javascript button
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
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
{!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
All Answers
Are both buttons on same page ?
You can try use javascript global variable of type "Var" to store the Id and use it in other button call method.
Thanks
Thanks for your kind response. could you please render an example. how can i do it? because it's not reading the value of id.
{!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