How to set values in when the record is in related list

NaveenKumarSN
Tera Expert

Hi,

 

 

In the below related list approvers tab is there. in that tab approver records are there so i need to set approved where requested is available.

 

I need to add test step for that so please guide which step i need use.

 

1. Related List

NaveenKumarSN_0-1730459417131.png

2. File value

NaveenKumarSN_1-1730459436760.png

 

8 REPLIES 8

Thanks for your quick response @NaveenKumarSN , Please refer to the below steps, I hope its work for you.

 

Open the Record:

I started by using the "Open a Form" step to open the record that has the "Approvers" related list.
In this case, the table was Change Request (change_request).
Navigate to the Related List:

Then, I added a "Click a Related List" step.
I set the related list name to Approvers, which allowed the test to move to the related list section on the form.
Set Field Values in Related List:

After accessing the related list, I needed to set the approval field for records where the State is "Requested."
To do this, I used the "Set Field Values in a Related List" step.
Related List Table: I selected Approvers.
Condition: I set a condition to filter the records where State is Requested.
Field to Set: I selected the approval field and set it to Approved.
Validation:

Finally, I added a "Assert Related List Field Values" step to verify if the records in the "Approvers" related list were updated correctly.
I checked if the approval field was now set to Approved for the relevant records.

NaveenKumarSN_0-1730713853530.png

There is no option like click a related list

select open a record in list

abhi159
Kilo Sage

@NaveenKumarSN  if you are using script  add the given code :

var incRecordSysId = steps('ba726cfa832956107cf166d0deaad3df').record_id;  //in steps use the sysid of step where you created that record.
 
    var grt=new GlideRecord('sysapproval_approver');
    grt.addQuery('sysapproval',incRecordSysId);
    grt.query();
    if(grt.next()){
        grt.state="approved";
        grt.update();
    }
 
Please mark this response as correct or helpful if it assisted you with your question.