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
Edited by and submitted by would usually be the same person as per my understanding. You can simply add these in a script and write record and then have a UIT. Else you can handle in the UI if you are using a start form. But will not capture the first one as soon as someone clicks on the record action.
The requirement is for the comment in the database field means if someone clicks then the comment should be "supervisor questionary edited by" and when he submits the dialogue box, the comment should be "submitted by" like this.
Hi,
So this will be two rows? or the same row you want to update?
May be on click you have to execute writetorecord/writetods function with details and capture the output, again update the same field with submitted by and write to data base.
I am still struggling to understand the requirement here.
swapnilk0010 said:then the comment should be "supervisor questionary edited by" and when he submits the dialogue box, the comment should be "submitted by"
Are you planning to store something in the comment field or you will have two columns with the names "supervisor questionary edited by" and "submitted by"
The comment is a column in the database table. And the requirement is if I click on the record action field, first, the comment column should automatically update it to "edited by supervisor" text and then after submitting the form which is being used in the record field action, the comment field should modify to text "submitted by supervisor:" like this.
It is the same field I want to update.
I hope these are two different entries in the database table, else you would simply overwrite the first input with the second one making the 1st input useless.You can have a script task which would construct the data for the comment and then write the first value to records node and then have your UIT and followed by the write records which would write the form data and the comment data which contains the submitted by.
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.