
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 02:28 AM
Hi,
Im trying to get the full name when choosing several parent in a field the has tree_picker = true;
for example: The location field is configured as a tree by default so when you choose a a city for example you get just the name of the city but you have configured your field by (location.full_name) you get the city and its country.
do you have any idea how i can do that please.
thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 11:01 AM
Hi Adil,
I have implemented in my local system and everything is working fine.
Please find the details of the implementation -
The table definition as follows - Parent field should have an attribute tree_picker = true
The Full Name column should be calculated and code should be like this -
FYI, the code below -
(function() {
var resultName = current.u_name;
var parentId = current.u_parent;
if (!gs.nil(parentId)) {
var grParent = new GlideRecord('u_location_sri'); //write your table here
grParent.addQuery('sys_id', parentId);
grParent.query();
if (grParent.next()) {
resultName = grParent.u_full_name +"/"+current.u_name;
}
}
return resultName;
})()
I have inserted few records to test the functionality and everything is working fine -
I think your issue is resolve, hopefully
Mark if it is correct or helpful.
Tomorrow, I will try to give you the details of creating the table without column name starting with 'u_'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 09:48 AM
Im so thankful , but it doas not work, i tried it and put the script carfuly but something still missing !
it worked for you ?
why i can't create columns without 'u_' ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 09:53 AM
I will try on my system and will let you know.
There is some hack not to create element with u_, I dont remember now, I will try to recall and will let you know that too.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 10:02 AM
ok thank you so much for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 11:01 AM
Hi Adil,
I have implemented in my local system and everything is working fine.
Please find the details of the implementation -
The table definition as follows - Parent field should have an attribute tree_picker = true
The Full Name column should be calculated and code should be like this -
FYI, the code below -
(function() {
var resultName = current.u_name;
var parentId = current.u_parent;
if (!gs.nil(parentId)) {
var grParent = new GlideRecord('u_location_sri'); //write your table here
grParent.addQuery('sys_id', parentId);
grParent.query();
if (grParent.next()) {
resultName = grParent.u_full_name +"/"+current.u_name;
}
}
return resultName;
})()
I have inserted few records to test the functionality and everything is working fine -
I think your issue is resolve, hopefully
Mark if it is correct or helpful.
Tomorrow, I will try to give you the details of creating the table without column name starting with 'u_'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2016 02:44 AM
you are amazing i thought that it does not gonna work cause i'm using that table as a reference in another table, but it works so good, thank you so much.
I have 2 question please.
can please tell me what that ".nil" means ?
how it fil in the field full name without telling it that by the g_form ?
thank you so much, it was helpful completely.
thank you so much, is was helpful completely.