Popup/Info Message for the approval widget on portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:32 PM
Hello All,
For the Approval Widget on the portal I want to show the popup once you clicked on the record but only when logged in user doesn't have approver role.
I have tried to do that but it showing every time
Any Idea how can this be achieved?
Thank you in advance!
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:33 PM
Can you share your code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:48 PM
HTML template:
<a ng-click="{{data.ShowMsg}}" ng-href="?id=approval&table=sysapproval_approver&sys_id={{::approval.sys_id}}" title="{{data.ViewAppMsg}}">
<span ng-if="approval.task.number">{{::approval.task.number}}</span>
</a>
Server Script:
if (!gs.hasRole("approver_user")){
data.ShowMsg=gs.addInfoMessage('Testing MSG');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:59 PM
Hi Sudeep,
Server Script:
if (!gs.hasRole('approver_user')) {
data.showMsg = true;
}
Client Script:
$scope.showMessage = function() {
if (c.data.showMsg) {
alert('Testing MSG');
}
}
HTML template:
<a ng-click="showMessage()"
ng-href="?id=approval&table=sysapproval_approver&sys_id={{::approval.sys_id}}" title="{{data.ViewAppMsg}}">
<span ng-if="approval.task.number">{{::approval.task.number}}</span>
</a>
I was unable to test this as my instance is updating currently. But this way it should work.
Let me know if you have any further questions.
Edit:
Forgot to add that if you want to have the standard addInfoMessage you will have to inject spUtil in your controller (Client Script) at the top. Then simply use spUtil.addInfoMessage instead of alert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2022 02:30 AM
Hi Sudeep,
did my reply help or do you have further questions on this topic?