'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

Are you using the "Requested For" variable to override the "Requested For" field on RITEM ?


nmcl
Giga Expert

Thanks.   I thought this might be the answer.



I've created the new field and am amending the variable to point to this.


Within the existing variable I have catalog client script...


catalog_client_script.png


Should I be updating this (updateRequestedFor) to be pointing to the new field?   I cannot work out how to do so.


first placed the variable in the catalog ... have a onsubmit or onload script to fill the value in the variable.. Later add a before insert business rule on the requested item table...


script :


current.yournewfield = current.variables.updateRequestedFor;


I'm not sure the last part is working. I've put the script in as...



current.u_requested_for = current.variables.updateRequestedFor;




The first part is the new 'requested for' field that I've created on the RITM form.


What is the last 'current.variables.updateRequestedFor' referring to?




I can now see in the variable section showing on the RITM form that the 'variable' question is showing as the customer chosen.


I just need this to populate the 'u_requested_for' field on the RITM form itself.


oopsy I should i mentioned it properly ...



current.yournewfield = current.variables.variableNameFromCatalog;