Skip to main content
April 25, 2024
Question

Regarding Record field action

  • April 25, 2024
  • 8 replies
  • 0 views

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?

    8 replies

    konduruc733182
    April 25, 2024

    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.

    April 25, 2024

    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.

    konduruc733182
    April 25, 2024

    I am still struggling to understand the requirement here.

    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"

    karthikk538
    April 25, 2024

    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.

    April 25, 2024

    It is the same field I want to update.

    shubhama926776
    Brainy
    April 25, 2024

    Hello [mention:2b38d12ffa9e4814b6cfcc9f64da75bc:e9ed411860ed4f2ba0265705b8793d05] 

    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.

    शुभम्