Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to open pop up message only once in Portal

DB1
Tera Contributor

Hello All,

I have a pop up message open from a widget as shown below

<script type="text/ng-template" id="modalTemplateStatus">
<div class="panel panel-default">
<div class="panel-heading">
	<h4 class="panel-title"><b>Here are the roles you can add/remove using this request:</b></h4>
</div>
<div class="panel-body wrapper-xl">
<form name="modalTemplateStatus">
<div class="form-group">
 <p><b>Authorized approvers:</b> Test</p>
 
 <p><b> Authorized callers:</b>  Test</p>
 
 <p><b>Watchlist:</b>Test</p>
 
 <p><b>Test.</p>
 
</div>
<button type="button" class="btn btn-primary" style="color:white;" ng-click="c.closeModal()">Ok</button>
</form>
</div>
</div>
</script> 

And I open it every time the Page opens or loads as below

 

c.modalInstance = $uibModal.open({
templateUrl: 'modalTemplateStatus',
scope: $scope
});

c.closeModal = function() {
c.modalInstance.close();
};

 

However, I also have other Modals open and close and refreshes. At that point this message populates everytime the page is reloaded or refreshed - 

c.data.field = n;
c.data.action = 'addrole';
c.server.update();
location.reload();

});

How to stop this from loading again and again. Instead I would want the message to be populated only once.

 

@jaheerhattiwale @Community Alums @Ankur Bawiskar @Basheer @-O- 

 

Thanks,

 

1 REPLY 1

-O-
Kilo Patron

When you say "Only once", you mean once in the lifetime of the user? If not what would be the difference between a load that is supposed to display the dialog and what would be a reload that is not supposed to display the dialog?

Like a user opens the portal in two browser tabs. Than closed the browser altogether, than again opens this particular page in 2 tabs. The following day does the same. When should the dialog be shown? On first day only?

Each day? On first (browser) tab? On all browser tabs?