- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2017 03:52 PM
We've run into an issue where we have a custom parent request form that has a related list and we'd like to add an action on that related list to create a new related record to this parent but copy over some of the parent's data over to the newly created record.
Ex. I have a Telecommunications Request Form that has basic data on it (Requested By, Telecommunication Closet Number, Type of Request, Service Code) and a related listing of Circuits that is derived based upon the Telecommunication's Closet Number.
I also have a Circuit table that has circuit specific data on it (Circuit Name, Power Type, Grid Name and also has a spot for the Telecommunication Closet Number for which it lives).
So in our case, Telecommunication Closet 45 already has three network circuits in it but I'd like to add a new circuit by letting the user press the New button on the related listing.
The problem is that when we create this new List UI Action, we can't seem to get the Closer # from the parent Request to put into the newly created child Circuit because we can't figure out how to collect and push that data to the new record. We believe this is because the action actually resides on the child Circuit form so anytime we do a 'current.' action it's not on the correct table and we end up getting this error message:
Can anyone provide us with a solution to actually be able to pull the parent's data into the child record using a List UI Action while allowing the user to input any other data into the new child record before it's saved to the database?
Any assistance would be greatly appreciated. Here is a copy of our logic so far:
// Open a new Glide Record in the circuit Table
var circuit = new GlideRecord('u_circuit');
circuit.initialize();
circuit.u_site_id = current.u_site_id; <<< Here's the Issue!
// Set the Form Fields Based Upon the NetTN Request Entered Data
circuit.insert();
action.setRedirectURL(circuit);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 06:52 AM
I think this is the issue. Because it is a queried relationship there is no guarantee that it only has 1 parent so parent can't be provided. Try this instead in a client ui action:
function insertNewCircuit() {
document.location = 'u_circuit.do?sys_id=-1&sysparm_query=u_nettn_request=' + g_form.getUniqueValue() + '^u_site_id=' + g_form.getValue('location');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:47 AM
Create a copy (using insert and stay) of the global button but specifically on your u_circuit table. Then deactivate the copy. The inactive copy will override the global ui action with the same action name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:53 AM
We tried this to no avail.
~ J ~

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:56 AM
There are multiple global 'New' ui actions. One is specifically for related lists. Is that the one you copied or did you perhaps get one of the others?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:59 AM
We copied all three global New UI Actions for the circuit table and inactivated them just to be sure.
~ J ~

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 12:22 PM
I'm making this harder than it needs to be. Right click on the related list and select Configure->List Control and select 'Omit New Button'.
The other should have worked too. If the omit doesn't work check to be certain there isn't another ui action also labeled 'New' against the circuit table?
I was able to override the global with a disabled table specific action even against a defined relationship.