How to create a Visualforce button to call Conga Composer
To create a Visualforce command button to call Conga Composer, you’ll need to access the current Partner Server URL endpoint. We’ve seen at least two techniques to accomplish this.
Technique #1
Alternatively, if you must access Salesforce Reports, you would need ServerUrl from a "front-end" server, and then pass that value into the Visualforce page. This is easy to do if you happen to be calling your Visualforce page from a button since you can pass the ServerUrl as querystring parameters, like this:
/apex/MyPage
?ServerUrl={!$Api.Partner_Server_URL_130}
Technique #2
Another technique to create a simple Conga Composer button on a Visualforce page would be as follows. We particularly like this technique because you can create a normal Conga Composer button on an object, and simply “point” to the standard button on the Visualforce page.
<apex:commandButton value="Create PDF Quote"
action="{!URLFOR($Action.Opportunity.View,Opportunity.Id)}"
onclick="openConga()"/>
<Script Language="JavaScript">
function openConga() { window.open('{!URLFOR($Action.Opportunity.Do_The_Conga,Opportunity.Id)}', '','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes, toolbar=no,location=no,status=yes'); }
</Script>
Do_The_Conga is referring to the API name of the standard button which you are trying to click via the Visualforce button.
