Requested For location

harish11
Mega Expert

I have custom requested for field (Column name: u_request_user) on our task forms and i have created another custom field for location (Column name: u_requested_for_location).

On task forms, am trying to set the field to load, when a task is created. Can someone help with the script please.

1 ACCEPTED SOLUTION

current.location = current.variables.requested_for.location.sys_id;


View solution in original post

8 REPLIES 8

Thank you. It worked.


harish11
Mega Expert

Hi Guys,



Any chance if you can help with this. I have been trying to populate the 'Location' field with the Requested for location, on the Request task form with a simple BR. But for some reason, the field continues to remain blank. Location field is pulled off the task table and have the same field on my incident form as well.




The rule i have set is:


Set Location same as 'Requested For' location. Have also tried,


Table: Catalog Task


Rule: Current.location = current.variables.requested_for.location.getDisplayValue();



Have checked for any default rules which might be stopping this being populated. Any idea what I could be missing.


try an onchange CS on the requested for field:



var loc = g_form.getReference('u_request_user');


userloc = loc.location;


g_form.setValue('u_requested_for_location', userloc);


harish11
Mega Expert

Can you please post the whole script (as I am not a script expert). Thank you.