"Requested For" on the Request Form and the RITM

velvet
Mega Guru

On a Request form, the wrong information is in the Requested For.   For Example, if   I use the Hardware Request Form and select Requested for as User A, opened by is User B.

On the REQ it shows the Requested for as User B.. It should be User A.

On the RITM it shows the Requested for as User A.. that is correct.

Why is User B showing up as the Requested For, when on the Request form it was selected correct.

And how can I fix this.

1 ACCEPTED SOLUTION

SD29
Tera Expert

Hi velvet,



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



Thanks,


SD


View solution in original post

10 REPLIES 10

Hi Velvet,



Is your Requested For column a custom column? One that you created?




Regards,



Roehl Tablada


I didn't create it, maybe the vendor.. I am new to sn


SD29
Tera Expert

Hi velvet,



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



Thanks,


SD


I will try this


velvet
Mega Guru

Snow123



I tried that before but when i do that....it works for the REQ and the RITM... BUT from the portal view, the req goes under the requested for's My requests, and the Requested for on the portal show the opended by in the Requested for.......