Regarding Reference Field in Embedded List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2016 03:26 AM
I have a Table (Lets call it table X )with an embedded list (lets call embedded list table as Y).
The embedded list contains a reference field (Lets call the reference field as Ref_Parent ) referencing table X.
I need to build a reference qualifier on Ref_Parent which will be depending on the sys_id of the parent record of table X that is holding the embedded list.
Is there a way to get the sys_id of Parent record of embedded list before actually saving it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2016 03:33 AM
Yes, by the time you open the record in the table, you dont have submit it but already a sys_id will be assigned to the record which you can use to manipulation.
To verify you can write an onLoad script with the script -
function onLoad() {
//Type appropriate comment here, and begin script below
alert(g_form.getUniqueValue());
}
When you open the record, 32 bit sys_id pops out. You can use the same in the reference qualifiers also by getting the sys id of the record.
Mark if it is helpful or correct, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2016 03:50 AM
Thanks for your Response!
As you must be knowing that there is a reference field that connects two tables in order to create an embedded list.
Lets continue with my above example, and let that reference field be Ref_connect (Ref_connect stores the sys_id of parent table's record)
What is happening is that, when I list edit to create a new record in embedded list, I agree that a sys_id gets allocated to this embedded list record, but still this Ref_connect field stays blank until and unless I save this record. In my case I require this value so that i can built a reference qualifier based on the value of field Ref_connect for a reference field Ref_Parent.
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2016 10:23 AM
I think I have found a way around this issue. Our particular requirement is that on an Incident form we have an embedded list of Affected Assets - a custom table that provides a many-to-many relationship between Incidents and Assets. When a new row is added to the embedded list, we want to restrict the choice of Asset to only those owned by the Company identified in the Incident record. The problem is that when you click the magnifying glass on the Asset field on the new row, the reference qualifier doesn't have a reference to the parent Incident. Our solution is a little complex, but it does seem to work. We use Session Client Data to pass the information into the reference qualifier function.
We have a Display business rule on the Incident table that stores the sys_id of the Company from the Incident record:
gs.getSession().putClientData("IncidentCompanySysId", current.company.toString());
We have a script include that holds the reference qualifier function:
function BBrefQual(){
var s = "company=";
s+= gs.getSession().getClientData("IncidentCompanySysId");
return(s);
}
And finally we have the advanced reference qualifier on the Asset field of the custom table that is embedded on the Incident form:
javascript:BBrefQual();
This assumes that the only way to create an Affected Asset record is via the embedded list, which in our case is true. It also assumes that if you change the Company on the Incident form, you must save the record before adding any rows to the embedded list, so that the new Company value is written to the session client data.
I hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2018 08:59 AM
Hi to all.
I had the same issue with a demand estimates embeded list in a demand. It is also the only point where the demand estimates must be created.
I´ve used your solution and it works fine.
Thank you.
Luis Franco