Variable value is displaying the sys id

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2018 11:25 AM
I have a catalog item in which the user selects a drive (from a reference) and then I have a script to pull back the owner of the drive but it is giving the sys id vs the value. This information is on the cmdb table. I know that I should be able to make the display = true for one of those fields on the table, but because it is the storage file share there are securities which is locked and don't allow me to change the display.
I was told that I could use the getDispaly value, but I am not sure how to do this. I have a catalog client script where I am pulling back the current owner (see below). Not sure where to add this getDisplay value.
function onChange (control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.setValue("current_owner", "");
return;
}
var cmdb_ci_storage_fileshare = g_form.getReference('variable name',CallBack);
}
function CallBack(cmdb_ci_storage_fileshare) {
g_form.setValue("current_owner", cmdb_ci_storage_fileshare.owned_by); // single line text field
}
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2018 11:45 AM
instead of
g_form.setValue("current_owner", cmdb_ci_storage_fileshare.owned_by.name);
try
g_form.setValue("current_owner", cmdb_ci_storage_fileshare.owned_by.user_name);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2018 11:56 AM
Shane it is pulling back empty now. No errors but nothing either.
Thanks,
Karen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2018 12:03 PM
Does the user you're referencing in the owned by field have a user id on their user record?
If so try changing
g_form.setValue to g_form.setDisplayValue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2018 08:20 AM
Hi Steve - that didn't work either.
And in addition, the customer decided that field was no longer needed.
Thank you for your assistance.
Karen