- 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 12:42 PM
That did it. Thanks for all your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2021 12:56 AM
i am facing the similar issue but my url is not getting redirected to the page.Can you please help?
function createInteraction()
{
var url = 'u_interaction.do?sys_id=-1&sysparam_query=parent='+current.getUniqueValue(sys_id) + '^u_interaction_summary='+current.getValue('number');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2021 05:51 AM
getUniqueValue doesn't take any parameters but you provide it the undefined variable sys_id. Try calling current.getUniqueValue().

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 06:43 AM
I've added a u_circuit table with those to fields to more closely replicate what you are doing. I'm using a reference to incident as a proxy for u_nettn_request and location as a proxy for u_site_id. I don't receive the error you are getting on my Istanbul instance. But I believe parent has been around for a while and you should see it in some of the other OOB ui actions. Below is my current action and results:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 06:49 AM
We're on Helsinki but I'm not for sure that would make a difference. Very odd.