- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2022 01:39 AM
Hi
i had used you code ,when i had same requirement but its didn't work can you help with this
this is the code which i had used
HTML :
<div class="col-xs-12 col-sm-6 col-md-4"
ng-class="{'col-md-6' : (c.data.openIncident && c.data.submitCatalog)}"
ng-if="c.data.submitCatalog || data.url_suffix || 'spc' != data.url_suffix">
<button role="button" ng-show="showCategory" class="btn btn-secondary-black" ng-click="kbSubmitRequest()">{{c.options.catalog_button_text}}</button>
</div>
Serverscript :
(function() {
data.showCategory = false;
//to show button for spc catalogs
var showCategory = true;
data.sc_cat_item = $sp.getCatalogItem(data.sys_id);
if (data.sc_cat_item.category) {
var categoryGR = new GlideRecord('sc_category');
categoryGR.get(data.sc_cat_item.category);
data.category = {
name: categoryGR.getDisplayValue('title'),
url: 'spc?id=ays_kb_article&source=search&sys_id=' + categoryGR.sys_id
};
if (data.category.name === "spc catelogs") {
showCategory = true;
}
}
})();
Any helpful thoughts and
Thanks
Mounish