0

I am trying to write callout to connect congacomposer, didn't get any error but it showing url not specified properly in debug logs.

The same url I used in generate button click. it is worked. please advice me. From one youtube link I got this link. https://composer.congamerge.com?serverUrl={!API.Partner_Server_URL_370}&id={!EDMAForm__c.Id}

EDMAForm is our custom object.

Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('https://composer.congamerge.com?serverUrl={!API.Partner_Server_URL_370}&id={!EDMAForm__c.Id}  '+id);
req.setMethod('GET');

HttpResponse res = http.send(req);
String strresp='';
System.debug('response <<<<<<<<<<'+res.getStatusCode());
System.debug('response<<<<<<<<<<'+res.getBody());

1 Answer 1

0

The {!fieldname} syntax that you're using is called a merge expression (or a merge field), and is not going to do anything when included in a string in Apex (like what you have). Those are only for use in Visualforce, workflow, formula fields, etc...

You could create a formula field to get you the value of the partner server URL (or hardcode it), and you'll need to insert or query EDMAForm__c to be able to get an Id for one of those records.

You must log in to answer this question.

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