- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 04:39 AM
Hi All,
I have a requirement in service catalog like If the service offering is set to 'XXX' the following 'AssetCtask:Deliver/Install IT equipment' task template should be deactivated. How it can be achieved?
Can we acheive it using OnSubmit Client Script?
Thankyou.
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 05:51 AM
I wrote a code on the Template Spawn hierarchy to make it work. It worked. Thankyou.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 01:02 AM
Hi Karthik,
Because you need to access server code and i'm assuming the task template information is not visible to the end user I would consider using a business rule to do this.
Trigger is Service Offering == 'valuehere' and catalog item is == 'x'
Then do a GlideRecord call to find the task template and set active = false.
You could do this with a Client Script and a GlideAjax call to the server database too.
Please mark my answer as helpful/correct based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 02:06 AM
Thankyou i will try below code
Before Buisness Rule:
var gr = new GlideRecord('sys_template');
gr.addQuery('sys_id','865bc849540207073309506393994944t975879949');
gr.query();
if(gr.next()){
current.active='false';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 02:36 AM
Before Buisness Rule:
var gr = new GlideRecord('sys_template');
gr.addQuery('sys_id','865bc849540207073309506393994944t975879949');
gr.query();
if(gr.next()){
current.active='false';
}
I tried the above code and still the Task template is in active status

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 03:47 AM
Hi,
Remove the '' around false,
You have: current.active='false';
Try: gr.active = false;
gr.update();
You need to use the gr object that you initialized to get the record