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.
vfpage:
<apex:commandButton value="Generate Invoice" action="{!GenerateInvoice}" onclick="openConga(setOfIds)" reRender="table1"/>
<script>
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}"
+"&serverUrl={!$API.Partner_Server_URL_290}&Id={!Payment_Id}"
+"&QVar1Id=[sql1221]a186C0000007yB3?pv1="
+ finalSetIds
+"&TemplateId={QVar1}";
window.open(CongaUrl, "Conga","menubar=no,height=600,width=800");
}
}
</script>
controller:
[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;
}