Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Set the "requested for" on an RITM from from a variables Form

MaramA
Tera Contributor

Hello,

 

How can I set the value of "Requested For" from the variables form in RIMT?

For example, if "Requested For" in the Variables is 'A' (blue), it should correspond to "Requested For" in the RIMT form ('A' in red).

meaning: Show the user that we requested for him the item( "requested for" )

MaramA_0-1716455060288.png

 

1 ACCEPTED SOLUTION

dgarad
Tera Sage

Hi @MaramA 

Please try using this before BR on request table.




(function executeRule(current, previous /*null when async*/) {



  var grRITM = new GlideRecord('sc_req_item');    

 

grRITM.addQuery('request', current.sys_id);    

 

grRITM.query();    

 

while (grRITM.next()) {    

 

  if (!JSUtil.nil(grRITM.variables.requested_for)) {    

 

      current.requested_for = grRITM.variables.requested_for;

 

  }    

 

}})(current, previous);

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

View solution in original post

2 REPLIES 2

Ranjit Nimbalka
Mega Sage

Hi @MaramA ,

 

you can do this in catalog item process engine that may be a flow or workflow.

 

Regards,

Ranjit

dgarad
Tera Sage

Hi @MaramA 

Please try using this before BR on request table.




(function executeRule(current, previous /*null when async*/) {



  var grRITM = new GlideRecord('sc_req_item');    

 

grRITM.addQuery('request', current.sys_id);    

 

grRITM.query();    

 

while (grRITM.next()) {    

 

  if (!JSUtil.nil(grRITM.variables.requested_for)) {    

 

      current.requested_for = grRITM.variables.requested_for;

 

  }    

 

}})(current, previous);

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad