• Chau Trang 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
I created a custom button which executes javascript (Mass Delete). For me as system administrator it’s working perfectly but my user receives “insufficient privileges” when clicking on this button. The user can delete one record, this is working. But not multiple records with this button.
 
The button is on a view list of my custom object Requested_Agencies__c. It is a junction object between Accounts and Campaigns. So my user has full access (CRUD, view all, modify all) on my custom object, Accounts, Campaigns, Contacts and Leads. Enable API is also checked.
 
I think there must be a permission for users to execute javascript buttons? Please help.
 
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")}
 
var records = {!GETRECORDIDS($ObjectType.Requested_Agency__c)};
var strIDs='';
if (records[0] == null)
{
alert('Please select a record');
}
else
{
for (var n=0; n<records.length; n++)
{
if(strIDs == '')
strIDs = records[n];
else
strIDs = strIDs + "," + records[n] ;
}
window.location.href = '/apex/MassManager__MassDelete?deleteIds='+strIDs + '&selectedObject=Requested_Agency__c&retURL='+ window.location.href;
}