- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 01:37 AM
Hi everyone,
I would appreciate any help please with case I am facing.
I want to check whether CI is of a certain CLASS, let's say for example, Hardware.
If the selected CI is of the appropriate CLASS, I want to set the business service and service offering fields in read only,
I used glideajax, because dot walk in UI Policy doesn't respond as I want
client script:
script include:
What do I write in the condition in the last function in the client script
For the process to take place for me?
Thanks to all the helpers
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:05 AM
Hi @Tal5
I will suggest you to create one system property and provide cmdb classes as a comma separated value.
Make changes in your script include based on below code:
var excludeclasses=gs.getProperty("checkcmdbclass"); // get system property value
var gr=new GlideRecord("cmdb_ci");
gr.addQuery("sys_id","b4fd7c8437201000deeabfc8bcbe5dc1"); // pass cisysid
gr.addQuery("sys_class_name",'IN',excludeclasses);
gr.query();
if(gr.next())
{
return true;
}
else{
return false;
}
In client script use:
if (answer == true)
Please Mark this Helpful and Accepted Solution if it solves your issue.
Thanks & Regards,
Shikha Tyagi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:05 AM
Hi @Tal5
I will suggest you to create one system property and provide cmdb classes as a comma separated value.
Make changes in your script include based on below code:
var excludeclasses=gs.getProperty("checkcmdbclass"); // get system property value
var gr=new GlideRecord("cmdb_ci");
gr.addQuery("sys_id","b4fd7c8437201000deeabfc8bcbe5dc1"); // pass cisysid
gr.addQuery("sys_class_name",'IN',excludeclasses);
gr.query();
if(gr.next())
{
return true;
}
else{
return false;
}
In client script use:
if (answer == true)
Please Mark this Helpful and Accepted Solution if it solves your issue.
Thanks & Regards,
Shikha Tyagi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:08 AM
Thank you very much for your help, much appreciated