
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 02:37 PM
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);
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 06:47 AM
I was able to get this working by using the numerical value of the choice instead of the value or label.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 06:28 AM
Another question would be, would i create this BR for the primary record table? or for the related records table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 06:47 AM
I was able to get this working by using the numerical value of the choice instead of the value or label.
Thanks