Hide widget for incident record in serviceportal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 02:14 AM
Hello Everyone,
Greetings!
I have created a widget which will show approval details to end users that with whom the approval is pending, it will show the approver name.
It is working perfectly fine but this widget is showing for incident record also, i want to hide this widget for incident record.
Please find my below script for refernce.
HTML:
<div ng-if="!c.data.hideWidget">
<div ng-if="!c.data.appDetails.length">
No Approvals
</div>
<table class="table table-striped table-responsive" ng-if="c.data.appDetails.length">
<thead>
<tr style="border-radius:6px;">
<th>${Approvers}</th>
<th>${Group}</th>
<th>${State}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in data.appDetails" style="border-radius:6px;">
<td>{{::item.name}}</td>
<td>{{::item.group}}</td>
<td>{{::item.state}}</td>
</tr>
</tbody>
</table>
</div>
Server Script:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 03:47 AM - edited 07-30-2024 03:50 AM
Change line 1 from:
<div ng-if="!c.data.hideWidget">
to:
<div ng-if="data.hideWidget == true">
Also, I see you have gs.log() in your code.
Switch to gs.info(). log statements do not work in scoped apps.
Whereas info statements can be used in both global and scoped apps.
Edit: my original condition was incorrect, use this one please:
<div ng-if="data.hideWidget == false">