Create multiple related records when submitting a record

Amie Macejkovic
Tera Guru

HI,

I am trying to have multiple records created on a different table that are related to the original record when it's submitted.   I got this to mostly work,

but its not selecting the choice from the choice list as the value of the field. It will add a new choice and the rest of the logic on the form does not

work.

Here is the script I used on a UI action that allowed it to actually create the related records, but it doesn't use the choices from the choice list.   It's

like it's adding a choice to the choice list to use.

// Create BRM/PM member  

var member = new GlideRecord("u_ccb_members");  

member.u_ccb = current.sys_id;  

member.u_role = "BRM PM";  

member.u_ccb_function = "BRM PM";

member.insert();  

 

// Create Business/All Requirements approver member

member.initialize();  

member.u_ccb = current.sys_id;  

member.u_role = "Approver";  

member.insert();      

 

// Create SIT approver member

member.initialize();  

member.u_ccb = current.sys_id;  

member.u_role = "Approver";  

member.u_approval_type = "SIT";  

member.insert();  

// Create CAT approver member

member.initialize();  

member.u_ccb = current.sys_id;  

member.u_role = "Approver";  

member.u_approval_type = "CAT";

member.insert();  

action.setredirecturl(current);

1 ACCEPTED SOLUTION

Amie Macejkovic
Tera Guru

I was able to get this working by using the numerical value of the choice instead of the value or label.


Thanks


View solution in original post

6 REPLIES 6

Another question would be, would i create this BR for the primary record table?   or for the related records table?


Amie Macejkovic
Tera Guru

I was able to get this working by using the numerical value of the choice instead of the value or label.


Thanks