when i select the records in vf page ,after click on the VF Button the conga should be call along with id for generating the PDF but on button click the window is opening but showing error that "ID Parameter is missing" ? how to over come the issue? your reply will be appricated ,please reply asap.


<apex:commandButton value="Generate Invoice" action="{!GenerateInvoice}"  onclick="openConga(setOfIds)" reRender="table1"/>

function openConga(setOfIds){
  if(setOfIds !=Null){
  var Formastring=setOfIds.splits(',');
  var joinIds=Formastring.join("'|'");
  var removeSpace=joinIds.replace(" ","");
  var removeLeft=removeSpace.replace("[","");
  var removeRight=removeLeft.replace("]","");
  var finalSetIds=removeRight;
   var CongaUrl ="/apex/APXTConga4__Conga_Composer?sessionId={!$API.Session_ID}"
+ finalSetIds
 window.open(CongaUrl, "Conga","menubar=no,height=600,width=800");



[‎28-‎01-‎2019 12:13]  Sakhare, Ankita:  
public PageReference GenerateInvoice() {
    selectedEsr = new List < Payment__c > ();
    for (wrappayment wp: paymentList) {
        if (wp.selected == true) {
            Payment_Id = wp.pay.id;


    return null;

You should call the JavaScript method from onComplete instead of onclick. Because before your action complete his exceution you JS method get called with blank Id parameter

<apex:commandButton value="Generate Invoice" action="{!GenerateInvoice}"  oncomplete="openConga(setOfIds, '{!Payment_Id}')" reRender="table1"/>

Also, I suggest you pass the ID in parameters as if you are not rerendering that section you will still get the same exception.

| improve this answer | |
  • Thanks for your reply@tushar Sharma but this logic is not working,please give me idea any other way ? – HKV Jan 28 '19 at 7:13
  • @hari Payment_Id you might not be getting value in this. Check if you are getting correct value here. – Tushar Sharma Jan 28 '19 at 7:17
  • SharmaI have checked in the controller payement_Id is getting there – HKV Jan 28 '19 at 7:21
  • ,I have tried another way also, The conga page is getting there,But Facing error Parameter Id missing Like :<Script Language="JavaScript"> function openConga() { window.open('{!URLFOR($Action.Payment__c.Generate_PDF, Payment_Id)}', '','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes, toolbar=no,location=yes,status=yes'); </Script> – HKV Jan 28 '19 at 7:22
  • Button :Button:<apex:commandButton value="Generate Invoice" action="{!GenerateInvoice}" onclick="openConga()" reRender="table1"/> – HKV Jan 28 '19 at 7:25

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.