How to populate assignment group on the Ritm form based on a reference variable?

Rini1
Tera Guru

Hi all,

So there is a field called area (u_area) on the location table. I have a variable (work_location_from) referencing location table on the catalog item. 

I am trying  to populate the assignment group on the Ritm form based on the location user selects on the form. And assignment group should the area of that specific location. Below is the runscript which Iam trying to execute but it doesnt work.

current.assignment_group = current.variables.work_location_from.u_area;
I also tried "current.variables.assignment_group = current.variables.work_location_from.u_area;"
Is it possible to push the area of the location into the assignment group on the ritm form?
 
Thanks
Rini
8 REPLIES 8

Brad Bowman
Kilo Patron
Kilo Patron

Are you certain that the work_location variable is populated when this script runs?  Is the u_area custom field on the location table a reference to the sys_user_group table?

Iam not sure how to check if the 'work_location_from' is populated or not. 

No the custom choice field 'u_area' is not present only on the User table, but its a list of assignment groups.

It's fine if u_area is a choice field, but the value must agree with what assignment_group on the RITM record is looking for, which is a sys_id since this field is a reference to the group table. So your choices for u_area can have Labels that are meaningful group names, but the Values must be the sys_id of each sys_user_group record.

Did you mean backend value of the Area choices? If yes, No the values are different for the Area choices (its not the sys_id of the each sys_user_group record). I am just wondering if I change the value for the Area to sys_id of the respective group will that work?

We have 172 locations which is linked with 3 Area (attached screenshot for reference). Say the location names are 1,2,3 and area is A,B,C (location 1 linked with A, 2 with B etc)and when the user choose the location '1' on the catalog form, Area 'A' should be populated on the assignment group of the Ritm.

Thanks

Rini