Dynamic Reference Qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 03:08 AM - edited 02-18-2024 03:20 AM
Hi All,
I am trying to build a dynamic reference qualifier on incident form for the field called 'Service' which is a reference field of cmdb_ci_service. For some reason it is not giving me correct results.
Below are the screenshots:
Can any one let me know where I am making mistake?
Thanks,
Rooma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 03:25 AM
Hi Rooma,
In you script include where you have written return statement, replace 'return services' with below line:
return "sys_idIN"+services.join()
Please Mark my response correct if this solves your issue and hit Helpful button if this helps.
Thanks,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 03:26 AM - edited 02-18-2024 03:29 AM
Hello @Rooma1 ,
You script is incorrect that's why it's not working.
Replace Line no 10 & 13 with:-
//line 11
services.push(ga.getValue('sys_id')); or services.push(ga.sys_id.toString());
//line 13
"sys_idIN"+services.join(',');
Thanks,
Alka Chaudhary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 05:04 AM
@Rooma1 ,
Please try the below code and replace the sys id of ACME Africa company in line 2.
var ga = new GlideRecord('cmdb_ci_service');
ga.addQuery('company','86c1f3193790200044e0bfc8bcbe5d95');// ACME Africa company sys id
ga.query();
var services = [];
while(ga.next()){
services.push(ga.sys_id.toString());
}
return "sys_idIN"+services;
Thanks,
Alka Chaudhary