Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- General Development
- :
- List View Button Not Working As Expected
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
List View Button Not Working As Expected
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-03-2013 12:54 PM
I have a custom object that we put through the approval process and a custom button that allows for bulk approval from a list view. The button does not work for the designated approver but it will work for me, the administrator, and for users above the manager in the salesforce heirarchy. Is there something within salesforce preventing this functionality from working for the designated approver? We use custom approver fields if that makes any difference.
The button is an onClick JavaScript button, here is the script:
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit
var url = parent.location.href; //string for the URL of the current page
var records = {!GETRECORDIDS($ObjectType.Event__c)}; //grabs the Event records that the user is requesting to update
var updateRecords = []; //array for holding records that this code will ultimately update
if (records[0] == null) { //if the button was clicked but there was no record selected
alert("Please select at least one record to update."); //alert the user that they didn't make a selection
} else { //otherwise, there was a record selection
for (var a=0; a<records.length; a++) { //for all records
var update_Event = new sforce.SObject("Event__c"); //create a new sObject for storing updated record details
update_Event.Id = records[a]; //set the Id of the selected Event record
update_Event.Event_Status__c = "Approved"; //set the value for Status to 'Approved'
updateRecords.push(update_Event); //add the updated record to our array
}
result = sforce.connection.update(updateRecords); //push the updated records back to Salesforce
parent.location.href = url; //refresh the page
}
The button simply changes the picklist value but does not work for the user designated as approver in the approval process field.
-Natty

