You need to sign in to do that
Don't have an account?
Abhishek 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');
}
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');
}
To use, sforce.console.isInConsole(), I think you'll need to add this at the top: Hope that helps,
Dave