There is a bug with Xrm.Utility.getPageContext() when it is called inside the Action of a global notification. (Xrm.App.addGlobalNotification).

The expectation of Xrm.Utility.getPageContext() is that it is contextless... it should always return information about the current page being viewed by the user.

However, if you are on a record and create a Global Notification with an action which calls Xrm.Utility.getPageContext(), then navigate away to another entity using the site map, then click the action button in the Global Notification, the object returned by Xrm.Utility.getPageContext() does not contain information for the entity list that you're now on. Instead, it contains information from the record that was being viewed when the notification was added.

This is unexpected.

Category: General