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 J 1Abhishek J 1 

Unexpected Identifier from List Button

I have Created a List View button on OrderLineItem__c object and added it in related list of its parent Order__c, when i click on that button i am below error.
A problem with the Onclick Javascript for this button or link was encountered:

Unexpected Identifier
Code Is:
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 

var IdsToClone = {!GetRecordIDs($ObjectType.Order_Line_Item__c)}; 
var url; 
if(IdsToClone.length == 0){ 
alert("You must choose at least one record to clone"); 

else if(IdsToClone.length > 1) { 
alert("You can't clone more than one record"); 

else{ 
url = "/apex/OrderLineItemsManagement?id="IdToClone; 

if (sforce.console.isInConsole()) { 
srcUp(url); 
} else { 
window.open(url,'_blank'); 
}
monsterloomismonsterloomis
Hi Abhishek,

To use, sforce.console.isInConsole(), I think you'll need to add this at the top:
{!REQUIRESCRIPT("/support/console/38.0/integration.js")} // whatever version makes sense for you
Hope that helps,

Dave