2

I'm trying to generate a PDF attachment using conga composer and attach it to my custom object.

Find below the apex code used to construct the URL :

Map<String, String> parameters = new Map<String, String> {
            'sessionid' => UserInfo.getSessionId(),
            'serverUrl' => Url.getSalesforceBaseUrl().toExternalForm()+'/services/Soap/u/22.0/'+UserInfo.getOrganizationId()
        };
String congaEndpoint='https://Composer.congamerge.com/composer8/index.html';
String requestURL = congaEndpoint+
            '?SessionId='+parameters.get('sessionid')+
            '&ServerUrl='+parameters.get('serverUrl')+
            '&id='+parentId+
            '&QueryId='+congaQueryId+
            '&DefaultPDF=1'+
            '&TemplateId='+templateId+
            '&SC0=1&SC1=Attachments&AttachmentParentId='+parentId+ 
            '&OFN='+docName+
            '&APIMode=1';

Generated URL is working when I am executing it from developer console or using VF-Apex.

Using lightning component, I'm getting response as [Status=OK, StatusCode=200] but no attachment is created.

Any help/inputs are appretiable

Thanks, Shrikant

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.