0

I use onclick javascript to use with Conga Composer instead of URL to check validations. But I do get 'The id parameter is missing' error when running the code. It looks like the url does not get the ID.

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

if('{!Enrolment_Request__c.Validation_Failed__c}' == true)
{
alert('Please check values in all required fields.');

}else{
window.location.href = '/apex/APXTConga4__Conga_Composer?SolMgr=1?id={!Enrolment_Request__c.Id}';
serverUrl="{!API.Partner_Server_URL_370}";
Id="{!Enrolment_Request__c.Id}";

QueryId="[GetContactDataforETA]a2B0M000000HP1n";

TemplateId="a2J0M000000J9D4";

DS7="1141";

CSVisible="1141";

CSRoutingType="SERIAL";

CSRecipient1="{!Enrolment_Request__c.Workplace_SignatoryId__c}";

CSRecipient2="{!Enrolment_Request__c.LSA_SignatoryId__c}";

CSRecipient3="{!Enrolment_Request__c.Trainee_SignatoryId__c}";

FlattenPDFForms="1";
}
2

You have a logic problem here:

if('{!Enrolment_Request__c.Validation_Failed__c}' == true)

Ironically, "true" == true is false. Instead, just change it to:

if({!Enrolment_Request__c.Validation_Failed__c})

All of the code past window.location.href isn't doing anything; you're just assigning variable values.

Instead, you need to build all your query string parameters in to the URL:

window.location.href = '/apex/APXTConga4__Conga_Composer?SolMgr=1&'+
 'id={!Enrolment_Request__c.Id}&'+
 'serverUrl={!API.Partner_Server_URL_370}&'+
 // rest of code...
  • All working now – Jay Weera Jun 25 '18 at 23:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.