I'm using record field action as edit supervisor questionary button in the interface. I have a requirement that as soon as someone clicks the record action field, it should update a field in the database as edited by and when submits it, again the same field should be modified to submitted by. How can I achieve this?
Discussion posts and replies are publicly visible
Hello swapnilk0010
Correct me if my understanding is incorrect. When a record action is triggered, the 'comment' column should first update to "edited by supervisor." After the form associated with the action is submitted, the 'comment' should change to "submitted by supervisor.”
I assume you already have a process created for this. The first node of the process should be a script task that writes the value “edited by supervisor” into the comments column for pv!, which is passed as a parameter to the process. Do this in the script task. Write that pv! to the database using the WriteRecord smart service.
Then, the existing process remains the same: the task will be assigned to a user. When the user completes the task (submit), In UI buttonField component update comments fields to “submitted by supervisor” using the update function; otherwise, you can nullify the comments field using the update(If it’s not submit). After the userInput task, you can write pv! to the record using the same WriteRecord smart service.