ASSIGN VALUE TO A REFERENCE FIELD FROM A SCRIPT

Arely
Tera Contributor

I have a record producer and Im trying this:

If the value of the field site is 'Aguascalientes 1' then the assignment group is 'IT AGS'. 

Site is a select box field and assignment group is a reference field. I think the problem is in the reference field. My script is this:


if(current.u_it_request_place=='Aguascalientes Edificio 1'){
    current.assignment_group=IT Aguascalientes;
}

I'm trying to take the value of assignment group field but assignmment group takes the information from groups.

I think only need know how to assign a value in a reference field.

1 ACCEPTED SOLUTION

Steven Parker
Giga Sage

You have to use the sys_id of the record to apply it to a reference field.  So go to the Groups table and open the group, right click the header and "Copy sys_id" then do something like this:

current.assignment_group= 'sys_id_goes_here';

Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

View solution in original post

1 REPLY 1

Steven Parker
Giga Sage

You have to use the sys_id of the record to apply it to a reference field.  So go to the Groups table and open the group, right click the header and "Copy sys_id" then do something like this:

current.assignment_group= 'sys_id_goes_here';

Please mark this response as correct and/or helpful if it assisted you with your question.
Steven