Popup/Info Message for the approval widget on portal

Sudeep
Tera Contributor

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!

6 REPLIES 6

Lin
Tera Contributor

Can you share your code?

Sudeep
Tera Contributor

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');

}

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.

Hi Sudeep,

did my reply help or do you have further questions on this topic?