Launch Conga Conductor from a Skuid Page

I have read past posts on using Conga with Skuid. In particular this one:https://community.skuidify.com/skuid/topics/using_conga_within_squid?topic-reply-list[settings][filt… But I am still having issues.

I have a working Conga Conductor solution. The working Launch button url for Conga Conductor in my sandbox  is:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={!$Api.Session_ID}&serverUrl={!$Api.Partner_Server_URL_160}&ReportId={!APXT_BPM__Conductor__c.APXT_BPM__Report_Id__c}&QueryId={!APXT_BPM__Conductor__c.APXT_BPM__Query_Id__c}&RecordId={!APXT_BPM__Conductor__c.APXT_BPM__Record_Id__c}&UrlFieldName={!APXT_BPM__Conductor__c.APXT_BPM__URL_Field_Name__c}

I am only using a report ID and a url field name to execute this conductor. So per the previous post in the community I changed my url to:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{!$Api.Session_ID}}&serverUrl={{!$Api.Partner_Server_URL}}&ReportId=&UrlFieldName={!APXT_BPM__Conductor__c.APXT_BPM__URL_Field_Name__c} 





Sorry. Posting user error.

I changed my url to:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{$Api.Session_ID}}&serverUrl={{$Api.Partner_Server_URL}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

I get this error message:
You must supply a valid Salesforce session id and server URL.

Thoughts on what I am missing?

Case sensitivity is the culprit here, change the ID in Session_ID to have the d lowercase, and the URL to Url: see changes in bold

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{$Api.Session_Id}}&serverUrl={{$Api.Partner_Server_Url}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

Thanks Zach.Made those changes. This is now my url:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{$Api.Session_Id}}&a…

Still getting the same error message.

Here are two other variants to try:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{{$Api.Session_Id}}}&serverUrl={{{$Api.Partner_Server_Url}}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{{$Api.Session_Id}}}&serverUrl={{#encodeUrl}}{{{$Api.Partner_Server_Url}}}{{/encodeUrl}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

Thanks but still get same error message.

Daniel, what is your Salesforce instance? (e.g. na11, na12)? 

Try this, replacing the instance name (na11) with your Salesforce instance:

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{{$Api.Session_Id}}}&serverUrl={{#encodeUrl}}https://na11.salesforce.com/services/Soap/u/16.0/00DG0000000CHAv{{/encodeUrl}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

Right now I am working in a sandbox with instance name cs9. So I will try:
https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{{$Api.Session_Id}}}&serverUrl={{#encodeUrl}}https://cs9.salesforce.com/services/Soap/u/16.0/00DG0000000CHAv{{/encodeUrl}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c


Now I get a message in the Conga Conductor window that says “No records were selected to process.”

Well that’s good progress — check your report to make sure it is returning data?

The report returns data. Expecting 34 results.

The normal button on the standard Conga Conductor page returns full results. It works for me as admin and as a test user. I can certainly redirect users directly to the standard Conga Conductor page where the Launch button works without issue and have them Launch form there. But was preferring they Launch from the skuid page if possible.

Daniel, we’re bummed that this is still not working. Can you Grant Login Access to Skuid Support (and send us your org id) so we can take a look?

Access granted.

Hi Daniel,

Which Skuid Page in this org contains the button that launches Conga Conductor? 

Commissions_TabQueue is the page. Admin tab. Button is named Generate Invoices.



Okay, after much ado, here is the solution:

Short version: You have to create a Salesforce Custom Button / Link on your Commission object, and then choose this Custom Button / Link as the action that your Skuid Page Title Button will run.

Long version: 

(NOTE: Daniel, I have already done this for your Sandbox org)

1. Go to your Commission object in Salesforce Setup, and go to Buttons / Links / Actions.
2. Create a new Button / Link, called something like "Generate Invoices"
3. For Display Type, choose “Detail Page Button”.
4. For Content Type, choose “URL”.
5. For the URL, paste in the exact URL you get when you click “Launch” on your Conga Conductor button, only replace the Session Id with {!$Api.Session_Id} and the Server URL with {!$Api.Partner_Server_Url_160}, e.g.

https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx?sessionId={{$Api.Session_ID}}&serverUrl={{$Api.Partner_Server_URL}}&ReportId=00OK0000000TezS&UrlFieldName=Conductor_Commissions_Invoice__c

6. Save your button.
7. Back in your Skuid Page, change the Action Type of your Page Title Button to be “Custom: SF Button / Link”.
8. Select “Generate Invoices” from the list of buttons that is returned.
9. Save your page and preview.

Explanation

Why won’t the “Redirect to URL” action type work? The root cause of the issue is Session Id privileges. Salesforce issues different at least 6 different types of Session Ids depending on what context you’re in, all of which have different privileges (see this StackExchange post for more details). This is relevant here because your Conga Conductor is getting its merge data from a Report, rather than via a SOQL query. For Conga to run Reports, it has to have a top-tier Session Id — but Skuid runs in a Visualforce context, so the Session Id that Skuid Pages get is not privileged enough to run Reports. Fortunately, the workaround above circumvents the problem — by having your Skuid button run a Salesforce Custom Button / Link, you are in effect running in a more privileged session id / execution context.




Zach - Working in production. Thank you many times over.

Just wanted to comment about the reports issue - we were able to get Conga Composer to reference reprots through re-creating the button in the action framework. The issue wasn’t session id but the fact that reports needed the 15-digit ID of our master object. This got more complicated since we were calling our master object from a lookup relationship, so we went from 

&id={{{Opportunity__c}}} 

to

&id={{$Model.Opportunity.data.0.Id15}} 

And then we were able to call reports.

Now, we are having another problem where Conga forces you to re-authenticate via a salesforce login screen, which sometimes seems to kill the other pages where we are currently logged in and force you to re-login, and also makes it not work for some of our users who regularly login to two instances, eg. na9 and na4. For some reason Conga gets confused and tries to authenticate with the wrong instance.