help me to write javascript snippet of this onclick javascript button

edited July 2017 in Problems
{!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

Comments

  • edited July 2017
    Hi,

    Could you please share shot for better understanding?

     
    Thanks
  • edited July 2017
    I have solved this using
    var ids = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ return item.row.Id; 
    });

    Thanx Gopal for reply.
Sign In or Register to comment.