3

Is it possible to edit the URL that Conga Merge returns via a parameter?

On my Opportunity I have a Javascript button that opens a visualforce page in a new window. This page allows users to select one or many recipients of an email. After selecting recipients, the visualforce page redirects the user to a Conga Merge url and appends the recipients.

Everything works as intended, however when referencing a Salesforce email template to use, the template fails to load and throws a javascript error in the console:

Uncaught DOMException: Blocked a frame with origin 
"https://cs23.salesforce.com" from accessing a cross-origin frame.
    at https://cs23.salesforce.com/email/author/emailauthorframe.jsp?
email_type=html:83:34

After executing the conga redirect, my URL now reads:

https://c.cs23.visual.force.com/email/author/emailauthor.jsp

It seems like when Conga redirects to email.jsp, it retains the force.com domain. And if I manually change the URL to:

https://cs23.salesforce.com/email/author/emailauthor.jsp

The email template renders, bug free.

The URL is generated via:

 public void setContent() {
    String generatedUrl = 
    'https://composer.congamerge.com' +
    '?sessionId=' + getSessionId() +
    '&serverUrl=' + getServerUrl() +
    '&id=' + getOpportunityIdFromPage() +
    '&TemplateId=' + getCongaTemplateId() +
    '&queryId=[parentOpp]a301A000000HoN0,[ED]a301A000000HoMl,[CDS]a301A000000HoMv,[GCP]a301A000000HoMq,[CLS]a301A000000HoMb,[NSSO]a301A000000HoMW,[MA]a301A000000HoMg' +
    '&EmailAdditionalTo=' + getEmailAdditionalTo() +
    '&DS7=2' +
    '&EmailToId=003C000001I9Bxh' +
    '&p3_lkid=' + getOpportunityIdFromPage() +
    '&EmailTemplateId=00X18000000QYxg' +
    '&OCNR=1';

}

1 Answer 1

0

Try using Conga's oAuth and URLENCODE() approach here:

https://support.getconga.com/Conga_Composer/Building_Composer_Solutions/Composer_for_Lightning/00Configure_Conga_Composer_for_Lightning

public void setContent() {
    String generatedUrl = 
    '/apex/APXTConga4__Conga_Composer' +
    '?sessionId=' + getSessionId() +
    '&serverUrl=' + getServerUrl() +
    '&id=' + getOpportunityIdFromPage() +
    '&TemplateId=' + getCongaTemplateId() +
    '&queryId=[parentOpp]a301A000000HoN0,[ED]a301A000000HoMl,[CDS]a301A000000HoMv,[GCP]a301A000000HoMq,[CLS]a301A000000HoMb,[NSSO]a301A000000HoMW,[MA]a301A000000HoMg' +
    '&EmailAdditionalTo=' + getEmailAdditionalTo() +
    '&DS7=2' +
    '&EmailToId=003C000001I9Bxh' +
    '&p3_lkid=' + getOpportunityIdFromPage() +
    '&EmailTemplateId=00X18000000QYxg' +
    '&OCNR=1';
} 
3
  • This worked! Changing the base url from "composer.congamerge.com" to "/apex/APXTConga4__Conga_Composer" solved the problem.
    – Isaac L
    Commented Oct 12, 2017 at 21:01
  • 1
    I'm having the same issue but when I try this I get an error: Oops, there was an error rendering Canvas application [Conga_Composer]. Your browsing session has ended or is invalid. Please re-login to Salesforce.com again.
    – NSjonas
    Commented Oct 18, 2019 at 19:56
  • 1
    also support link is broken
    – NSjonas
    Commented Oct 18, 2019 at 19:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .