function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RustyrpageRustyrpage 

Apex Code Button to update fields

I have a problem where we lock a record after it has been approved, however, there is a single field on that record that needs to be updated by a certain group of people.  The only way that I can think to do it is to write a custom APEX code that will update the field.

 

Is there a way to  write a button that, when pressed will launch a picklist that pulls from my field & then allows the user to update that field using the APEX trigger (which runs as admin).

 

To summarize, we use Glovia Order Management, which creates Sales Orders inside of Salesforce.com.  Once the Sales Order has been approved by the sales manager, the record is locked, but we have a custom field called Fulfillment Status that has 8 picklist values - the fulfillment team needs to be able to modify JUST that field to move it around the fulfillment line - so the ideal scenario is a button that allows the system to change it as they go.  (but they need to be able to select the status).

 

Any ideas?

WilmerWilmer

Try using an URL button which calls a Visualforce page where you can add the additional fields you require to complete the task. Also, if you need to run as an admin user, add an apex webservice method to get that behavior.

 

I hope this helps,

 

Wilmer