Skip to main content

Should there be any difference between {!API.Session_ID}, skuid.utils.userInfo.sessionId and sforce.connection.sessionId? 

I am calling conga merge composer and keep getting the SFDC login page during the composing process.  The conga process does work in the end - but after I login again.  

My code:


var partnerServer = sforce.connection.partnerServerUrlse8];<br><br>var hcURL1 = '<a target="_blank" rel="nofollow" href="https://www.appextremes.com/apps/Conga/Composer.aspx'" title="Link https//wwwappextremescom/apps/Conga/Composeraspx">https://www.appextremes.com/apps/Conga/Composer.aspx'</a>+&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; '?sessionId='+sforce.connection.sessionId+<br>&nbsp; &nbsp; &nbsp; '&amp;serverUrl='+partnerServer+<br>&nbsp; &nbsp; &nbsp; '&amp;id='+model1m0].Id+<br>&nbsp; &nbsp; &nbsp; '&amp;CongaEmailTemplateId=a4Z500000004F01'+<br>&nbsp; &nbsp; &nbsp; '&amp;reportid=ooffice]00O50000003QupQ?pv0='+model1m0].Id+<br>&nbsp; &nbsp; &nbsp; ',sspouse1]00O50000003QrN4?pv0='+model1m0].Id+<br>&nbsp; &nbsp; &nbsp; ',sspouse2]00O50000003QrNE?pv0='+model1m0].Id+<br>&nbsp; &nbsp; &nbsp; '&amp;EmailToId='+model1m0].Id+<br>&nbsp; &nbsp; &nbsp; '&amp;EmailFromId='+model1m0].Adviser_Id__c+<br>&nbsp; &nbsp; &nbsp; '&amp;DV0=<a target="_blank" rel="nofollow" href="https://stuff.betterstfuff.com/?sf='+model1m0].Id" title="Link https//apphonestconversationscom/sfmodel10Id">https://stuff.betterstfuff.com/?sf='+model1m0].Id</a>+<br>&nbsp; &nbsp; &nbsp; '&amp;DS7=2&amp;LG4=1&amp;LG1=+My+Email+1';

Both return the same Session Id (a Visualforce Session Id). I seem to recall that other users have had trouble in the past trying to launch Conga from Skuid with Conga’s Report-driven document merge approach, as opposed to the Conga Queries document merge approach. The reason is that the Report-driven approach requires a “Salesforce” Session Id, as opposed to a Visualforce Session Id. Because Skuid runs in Visualforce, Skuid gets a Visualforce Session Id, which seems to work for Conga Queries / SOQL-query based merges. 

I searched the Community to try to find an example of someone succeeding with a Report-based Conga query launched from Skuid, but haven’t found one yet.


Zach, thank you for the response.  Is there an API to call a SF button via Javascript? 

For this:


Peter, will the button included on the Skuid Page? If so, you could give the Button a Unique Id and then trigger a click on it via JavaScript, e.g. via

skuid.$(‘#MyButton’).click();
or 
skuid.$(‘#MyButton’).trigger(‘click’);

If you don’t want the button to be included on the Skuid Page at all, then no, there’s currently not a documented Skuid API for doing this, but we could potentially add that if it was a significant need.


Thanks!  As an FYI here is how I solved this issue… feels pretty hacky but it works!


var partnerServerExternal = sforce&#46;connection&#46;partnerServerUrlsr24];<br />var partnerServer = partnerServerExternal&#46;replace("mycompany--skuid&#46;na1&#46;visual&#46;force&#46;com","mycompany&#46;my&#46;salesforce&#46;com");<br />&nbsp; &nbsp;&nbsp;<br />&nbsp; &nbsp; var URL = '<a href="https://www.appextremes.com/apps/conga/pm.aspx&#39;+" rel="nofollow" target="_blank" title="Link https//wwwappextremescom/apps/conga/pmaspx">https:&#47;&#47;www&#46;appextremes&#46;com/apps/conga/pm&#46;aspx'+</a>&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; '?sessionId='+sforce&#46;connection&#46;sessionId+<br />&nbsp; &nbsp; &nbsp; &nbsp; '&amp;serverUrl='+partnerServer+&#46;&#46;&#46;

Interesting! So you used the same Session Id, you just used a Server URL on the *.salesforce.com Domain tree, rather than on the *.force.com tree, and it worked — that is very helpful. Good to know.