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
Giga 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
Giga 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