I have never created a Java Script button before but I tried to create a List View button on our Invoice Object. Use Case: select multiple invoices and run Conga Composer button to view what invoices with invoice lines would look like when selected invoices are consolidated.
Here is my current button:
var ids= {!GETRECORDIDS ($ObjectType.SCMC__Invoicing__c)};
var idsReport=ids.join("|");
var idsQuery=ids.join("'|'");
var CongaURL = "https://composer.congamerge.com" +
"?sessionId={!$Api.Session_ID}" +
"&ServerUrl={!$Api.Partner_Server_URL_80}" +
"&Id={!$User.X18_digit_User_ID__c}" +
"&QueryId=aAQ5B0000008a34?pv0=" + idsQuery +
"&TemplateId=aAY5B0000004P7Z";
window.open( CongaURL, "Conga", "width=700,height=550,menubar=0" );
The error I am getting when I select 2 invoices and run the button:
SCMC__Invoicing__r.Id = 'a6E5B0000008t41','a6E5B0000008t4A' LIMIT 25000 ^ ERROR at Row:1:Column:1010 unexpected token: ','