0

I am currently trying to fire a Conga Conductor Batch from an Apex Class. I've gone over the documentation and other Salesforce Stack exchange questions. I can get individual records with Conga Composer to work, just not the batch Conductor which is what I need.

The Conductor is using a simple query and the code looks like this :

    String sessionId = UserInfo.getSessionId(); 
    String sfUrl = Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/28.0/' + UserInfo.getOrganizationId();

    APXT_BPM__Conductor__c congaVar = [Select id, APXT_BPM__Report_Id__c, APXT_BPM__Query_Id__c, APXT_BPM__URL_Field_Name__c, APXT_BPM__Record_Id__c FROM APXT_BPM__Conductor__c];  
String reqURL = 
    'https://www.appextremes.com/apps/conga/pm.aspx?SessionId=' + 
     + sessionId + 
    '&Id=' + congaVar.Id + 
    '&ServerUrl=' + sfUrl +
    '&QueryId=' + congaVar.APXT_BPM__Query_Id__c +
    '&RecordId=' + congaVar.APXT_BPM__Record_Id__c + 
    '&UrlFieldName=' + congaVar.APXT_BPM__URL_Field_Name__c +'&DS7=1';

System.debug(reqURL);

Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(reqURL);
req.setMethod('GET');
req.setTimeout(60000);

HttpResponse res = http.send(req);

System.debug(res);
System.debug(res.getBody());

return res.getStatus() + ' => ' + res.getBody();
  • so, are you getting an error? or the above URL string just returns a single record? – cropredy Sep 30 '19 at 21:40
  • @cropredy I am getting a response of 200 OK, but it is not firing or sending an error message – MMeadows Oct 1 '19 at 0:18
  • my experience with Conga is that three things to look for: a) case sensitive URL params, b) hidden spaces in values of URL params; c) missing URL params to achieve what you want. Conga has terrific customer support and I'd suggest you engage them – cropredy Oct 1 '19 at 0:20

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.