I want to build a process for users to request upd...
# suitescript
s
I want to build a process for users to request updates to Item records, but for those requests to be approved by another user prior to actually being implemented. What I'm thinking is: • User updates Item record in UI context • UE beforeSubmit Item: diff context.oldRecord and context.newRecord, store changes in a custom record. Throw an exception so the Item record doesn't actually save the update. • Custom Record to capture change requests and approval. Once approved, update the Item record. Anyone have thoughts on this pattern? Is there a better solution to this use case?
e
Clever approach. I use something similar for two record types: 1. For a custom record
My Custom Record
, I have another custom record
Change Request
with a replica of the only fields that matter to us. Once approved, a script replicates the changes. 2. For
vendors
, I have another Change Request custom record, with minimal fields (think the Requested Change and the Reason for the Change). Once approved, the owner of the
vendors
catalog manually make the changes.
c
@Steve at GrowGeneration keep in mind there are differences between how fields and their values appear in newRecord between EDIT and XEDIT contexts. Also, how do you plan to differentiate between the initial (request) edit and the subsequent approval edit? What happens if the same item is edited again while changes are pending?
r
I rather have a suitelet view for all the items, they can select the items and update them all at once. In the backend you create custom records for those items. Another suitelet view to see all those custom records and approve them in bulk. Deploy a userEvent on the custom record. Once the record gets approved through the bulk approval process. userEvent will trigger and update those fields.