'Requested for' field to be different for each RITM logged

nmcl
Giga Expert

Has anyone got around this issue...

 

A user adds multiple items to their cart in ESS - the 'Requested for' field for each item is set different (e.g. a PA logging two tickets for members in her team).

 

The REQ and all RITMs log with the 'Requested for' as the last customer to be set.


What we ideally need is for each item to take the relevant customer name and apply that to the 'Requested for' field in each RITM logged (and not just apply the name from the last item to all other items ordered).


We are not overly concerned with what name gets populated in the parent REQ record for the 'Requested for' - ideally, if there is one item in a REQ it would take the 'Requested for' name entered and if there are multiple items per order it would take the 'Opened by'.


The response from Hi is...

I understand your requirement here. But thats an expected behaviour. This is because the 'Requested For' field is on the 'sc_request' table. Whenever an user submits a cart with many catalog items, it always creates one Request and multiple Requested Items. So, there will only one 'Requested For' and so it takes the Requested For as the last person whom you add it as Requested For in the Cart. There is no alternative for this.

1 ACCEPTED SOLUTION

oopsy I should i mentioned it properly ...



current.yournewfield = current.variables.variableNameFromCatalog;


View solution in original post

12 REPLIES 12

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Nat,



The current.field = current.variables.variablename should go into a before insert business rule on the sc_req_item table.



As for populating the variable, you can use a client script, but a better practice would be to put javascript:gs.getUserID() as the default value in your reference variable. That way the value will be set when the form loads and will be more efficient than a client script.


Thanks Brad and Kalai, all sorted


Close off the loop and mark the appropriate response as answered .. Cheers !