help me to write javascript snippet of this onclick javascript button

  • 1
  • Problem
  • Updated 1 year ago
  • Solved
  • (Edited)
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} 
{!REQUIRESCRIPT("/support/console/26.0/integration.js")} 

var ids = {!GETRECORDIDS($ObjectType.Ckte__c)}; 
if (!ids || ids.length < 1) 
alert("Please select at least one record."); 
else 

var redirectUrl = "/apex/loop__masslooplus?&retURL=" + encodeURI(window.location.pathname+window.location.search); 
redirectUrl += "&recordIds="+ids.join(","); 
redirectUrl += "&sessionId={!$Api.Session_ID}"; 
window.location.href = redirectUrl; 
}


for the above code i have written the following code to snippet:



var ids = {!GETRECORDIDS($ObjectType.Ckte__c)}; 
if (!ids || ids.length < 1) 
alert("Please select at least one record."); 
else 

var redirectUrl = "/apex/loop__masslooplus?&retURL=" + encodeURI(window.location.pathname+window.location.search); 
redirectUrl += "&recordIds="+ids.join(","); 
redirectUrl += "&sessionId={!$Api.Session_ID}"; 
window.location.href = redirectUrl; 
}

I m getting error in the first line } expected ........ dont know why this error help me
Photo of Matrix

Matrix

  • 590 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Gopal Agrawal

Gopal Agrawal

  • 598 Points 500 badge 2x thumb
Hi,

Could you please share shot for better understanding?

 
Thanks
Photo of Matrix

Matrix

  • 590 Points 500 badge 2x thumb
I have solved this using
var ids = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ return item.row.Id; 
});

Thanx Gopal for reply.