- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 10:23 AM
Hello,
I have a parent table (table1) that extends the CMDB table. I also have another table that extends table1 (table2).
I created a UI action on Table 2 that will create a record on Table1 with the data from Table2. This works without issue except the choice lists I have on Table 2 does not go over to Table 1 even though the choice lists contain the same names/values. I tested by forcing the value like this "phone.u_phone_manufacturer = "Apple";" and it worked without issue.
Any help would be appreciated... my script is below.
var phone = new GlideRecord('table1');
phone.initialize();
phone.u_phone_manufacturer = current.u_requested_manufacturer();
phone.assigned_to = current.assigned_to();
phone.u_type = current.u_type();
phone.u_color = "blue" ;
phone.insert();
action.setRedirectURL(phone);
action.setReturnURL(current);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 10:27 AM
var phone = new GlideRecord('table1');
phone.initialize();
phone.u_phone_manufacturer = current.u_requested_manufacturer;
phone.assigned_to = current.assigned_to;
phone.u_type = current.u_type;
phone.u_color = "blue" ;
phone.insert();
action.setRedirectURL(phone);
action.setReturnURL(current);
can you try like above without parenthesis '()'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 10:27 AM
var phone = new GlideRecord('table1');
phone.initialize();
phone.u_phone_manufacturer = current.u_requested_manufacturer;
phone.assigned_to = current.assigned_to;
phone.u_type = current.u_type;
phone.u_color = "blue" ;
phone.insert();
action.setRedirectURL(phone);
action.setReturnURL(current);
can you try like above without parenthesis '()'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 11:34 AM
Thank you! That worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 09:39 PM
Hello, I tried this, and the record was created in table1 and it was opening when I clicked the UI action. But the record is not shown in the list view of the table1 and I can't find where the record is saved. Can someone please tell me the solution
var phone = new GlideRecord('x_563957_e_governa_problem');
phone.initialize();
phone.u_complainer = current.u_string_1; //Name
phone.u_complainer_address = current.u_string_2; //address
phone.u_choice_2 = current.u_choice_6; //deptartment
phone.u_string_1 = current.u_string_4; //problem
phone.description = current.description; //description
phone.insert();
action.setRedirectURL(phone);
action.setReturnURL(current);
This is my code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 11:28 AM
Hi Darrell,
Like srnewbie said, removing the parenthesis should fix the issue (hopefully). But may i ask what the purpose of this is? Table 2 is extended from Table 1, so the record in table2 is essentially a part of 1. So whats the point of creating a redundant record? Especially since all the fields in table1 are available in table2?