function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhishek Prasad 8Abhishek Prasad 8 

Conga Issue- id Parameter is missing

We have got one button, which, with the help of conga composer, opens an attachment. I am leveraging the functionality of that button to create another button. Here is my VF code:
<apex:commandButton value="Generate Doc" action="{!CallProc}"  onClick="openConga();return false;" rendered="{!if(valErr == true, false, true)}"/>
and here is my JS script:
 
<Script Language="JavaScript"> 
             function openConga() 
                { 
                    window.open('{!URLFOR($Action.Contract1__c.Conga_Composer_Main_Doc, Id)}', '','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes, toolbar=no,location=yes,status=yes'); 

                }

        </Script>

It is successfully invoking the COnga Composer, and its opening the window, but it throws the error:
The id parameter is missing
can anyone help me? what should i pass as the Id? i have tried object__c.Id, but it not identifying it.
 
Best Answer chosen by Abhishek Prasad 8
Abhishek Prasad 8Abhishek Prasad 8
For anyone who would like to know the solution of this issue:

In the JS, i have accessed the record id from the Controller (ContractId) and used it in place of the id
<Script Language="JavaScript"> 
             function openConga() 
                { 
                    window.open('{!URLFOR($Action.Contract1__c.Conga_Composer_Main_Doc, ContractId)}', '','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes, toolbar=no,location=yes,status=yes'); 

                }

        </Script>
It was giving error that Id parameter is missing. Actually record creation and accessing the record id was happening in the same method, so VF was not able to catch the records id.
I added reRender which allowed it to refresh, and hence, it caught the record id:
 
<apex:commandButton value="Generate Doc" action="{!CallProc}"  onClick="openConga();return false;" reRender = "Id_Of_The_Block" rendered="{!if(valErr == true, false, true)}"/>


This is also the way to call two actions from one button.