- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2018 03:12 AM
This is a form where we have to get data name of a Computer[cmdb_ci_computer] table. I have written a catalog client script which manges to give the exact value of the Computer Name assigned to the User[sys_user]. However I am unable to get the Preview of the Data. Due to this I cannot see this value in the Requested Item as below:
Please help me to sort out this. since I have to deploy this as soon as possible.
Appreciate all the help. Thank You.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 08:07 AM
Hi Sonali,
Try using below snippet.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var empcidetails = g_form.getReference('select_user',setci);
alert('User is '+empcidetails);
function setci(empcidetails)
{
var CIdetails = new GlideRecord('cmdb_ci');
CIdetails.addQuery('assigned_to', empcidetails.sys_id);
CIdetails.query();
while(CIdetails.next())
{
//alert(CIdetails);
//alert('CI is '+CIdetails);
var a=CIdetails.sys_id;
// alert(a);
g_form.setValue('configuration_item',a);
}
}
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 02:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 03:45 AM
Hi Sonali,
Can you try once by checking the pop up columns once for necessary table.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 08:07 AM
Hi Sonali,
Try using below snippet.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var empcidetails = g_form.getReference('select_user',setci);
alert('User is '+empcidetails);
function setci(empcidetails)
{
var CIdetails = new GlideRecord('cmdb_ci');
CIdetails.addQuery('assigned_to', empcidetails.sys_id);
CIdetails.query();
while(CIdetails.next())
{
//alert(CIdetails);
//alert('CI is '+CIdetails);
var a=CIdetails.sys_id;
// alert(a);
g_form.setValue('configuration_item',a);
}
}
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 07:00 AM
Hey Sonali,
This could possibly be a security issue. Have you checked the cmdb_ci_computer/read ACL(s)?
Thanks,
Olyn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 12:54 AM
Thanks a Lot Jaspal for helping me out to sort this issue.
Appreciating all your help