- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2025 07:16 AM
I have added a tab to macroponent which I wanted to hide when customer_central plugin is absent.
one approach to add this is add macroponent definition in the if folder when plugin is present.
wanted to check if some other way exists where i can check if plugin is present in client script and show/hide depending on the value returned
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2025 08:04 AM - edited 03-02-2025 08:05 AM
Hi @Jyotshna_M ,
you can use GlidePluginManger API to check if the plugin is active or not.
create a Client Callable Script include which checks the plugin is active or not and use GlideAjax to check if the plugin active
Script
var testPluginUtils = Class.create();
testPluginUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isPluginActive: function() {
var a = new GlidePluginManager();
return a.isActive('put.your.plugin.id.here');
},
type: 'testPluginUtils'
});
Client Script
var ga = new GlideAjax('testPluginUtils')
ga.addParam('sysparm_name', 'isPluginActive')
ga.addParam('sysparm_plugin_id', 'sn_sns')
ga.getXMLAnswer(function(ans) {
if (ans == 'false') {
g_form.setSectionDisplay('your_section_name', false)
}
})
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2025 08:04 AM - edited 03-02-2025 08:05 AM
Hi @Jyotshna_M ,
you can use GlidePluginManger API to check if the plugin is active or not.
create a Client Callable Script include which checks the plugin is active or not and use GlideAjax to check if the plugin active
Script
var testPluginUtils = Class.create();
testPluginUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isPluginActive: function() {
var a = new GlidePluginManager();
return a.isActive('put.your.plugin.id.here');
},
type: 'testPluginUtils'
});
Client Script
var ga = new GlideAjax('testPluginUtils')
ga.addParam('sysparm_name', 'isPluginActive')
ga.addParam('sysparm_plugin_id', 'sn_sns')
ga.getXMLAnswer(function(ans) {
if (ans == 'false') {
g_form.setSectionDisplay('your_section_name', false)
}
})
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya