Skip to main content

Using Java Snippet for Custom Button to open Conga Merge 8.   Everything is working good except for passing the Id over.   If I hardcode an Id it works, but using {{Id}} throws a conga error “id parameter not valid etc…”  Tried using the Timeline__c.Id (custom object) but still the same result.   I am using a snipped so I can specify that the Conga window opens in smaller size window.  Any help or suggestions would be greatly appreciated.  My code is below:

var params = arguments 0],
$ = skuid.$;

var partnerServer = sforce.connection.partnerServerUrlse8];
var CongaURL = “https://composer.congamerge.com”+
“?sessionId=”+sforce.connection.sessionId+“&serverUrl=”+partnerServer+
“&id={{Id}}”+“&ofn={{Name}}”;
window.open( CongaURL, “CongaM”, “height=600, width=600, menubar=0” );

The following snippet should solve your problem replace lead with the Timeline__c model name

var params = arguments[0],
$ = skuid.$;

var partnerServer = sforce.connection.partnerServerUrls[8];
var CongaURL = “https://composer.congamerge.com”+
“?sessionId=”+sforce.connection.sessionId+“&serverUrl=”+partnerServer+“&id=”+skuid.$M(‘Lead’).data.0].Id +“&ofn=”+skuid.$M(‘Lead’).data0].Name;
window.open( CongaURL, “CongaM”, “height=600, width=600, menubar=0” );


This worked perfectly!   Thank you Paul


Here is the snippet code that worked for me.   We have been using this without a problem for at least a year.   At first I was using sf reports to pull in fields from another table, but that would not work.   Changed the reports to Conga Queries and all is good.   ‘Timeline’ is the name of our Custom Salesforce object (table).


var params = arguments 0],

$ = skuid.$;


var partnerServer = sforce.connection.partnerServerUrlse8];

var CongaURL = “https://composer.congamerge.com”+

“?sessionId=”+sforce.connection.sessionId+“&serverUrl=”+partnerServer+

“&id=”+skuid.$M(‘Timeline’).data0].Id+“&ofn=”+skuid.$M(‘Timeline’).datam0].Name+“&TemplateId=a070f00000oQWKV”+“&TemplateGroup=TLS”+“&QueryId=Vdr]a060f00000vaTpR,ever]a060f00000vaZlH,;det]a060f00000vaZlg?pv0=”+skuid.$M(‘Timeline’).datae0].Id;


window.open( CongaURL, “Conga”, “height=600, width=600, menubar=0” );


Reply