Related list on sc_req_item

Rajkumar Bommal
Tera Contributor

i Have created a catalog item 
when it proceeded to sc_req_item table i want to display already created records with same variable value records in related lists 
here is the demo for the realated lists 
past compliments : spefify staff is catalog item variable 
current req item record specify staff record also same so in related lists same specify staff records has been displaying 
 

RajkumarBommal_0-1740991412424.png

 

 


how can i archive that

Debasis Pati
Kilo Sage

Hello @Rajkumar Bommal ,

You need to create a relationship for that and then add the ralation ship to the related list in the relationship you can put your query in order to filter the ritms.

Example:
var gr = new GlideRecord('sc_req_item');
gr.addQuery('variables.specify_staff', current.variables.specify_staff);
gr.query();


Please mark it as correct/helpful if this helps you.

Regards,
Debasis


@Debasis Pati 
I know that it can be done bye creating relationship and add it to related list but i want the query that need to used to get this 

 

shubhamseth
Mega Sage

@Rajkumar Bommal 

 

Solution Approach

1️⃣Create a Reference Field (If Not Already Present)

  • Ensure that the Specify Staff variable is stored in the sc_req_item table as a field (e.g., u_specify_staff).
  • If it’s not, create a custom field (Reference type) on sc_req_item to store this value.

2️⃣Configure a Related List Based on Matching Records**

  • Navigate to System Definition → Related Lists.
  • Configure a new related list on the sc_req_item form layout.
  • Set it up to show records where u_specify_staff is the same as the current record.

3️⃣Use a GlideRecord Query in a Business Rule

  • Create a Business Rule on sc_req_item that dynamically fetches related records.
  • The Business Rule should run on Insert to display past records where u_specify_staff matches.

 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


@shubhamseth Can you please give me a script