Requested for is different on the form and on the RITM.

Atchutaram
Tera Contributor

Hi Experts,

Good Day!

                     I have recently created a catalog item. When we fill the form and give the name on the requested for variable and submit. I am getting  he Requested for name on the request and ritm is the the person who submitted the request.

Could you please help me how to solve this. the requested by and requested for are same on the RITM and Request. Even thought we change the requested for while filling the form.

 

Best Regards,

Atchutram

1 REPLY 1

Community Alums
Not applicable

Hi @Atchutaram ,

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);