Xrm.Page.ui Not Available on Primary Grid
While developing an EnableRule for some new functionality I decided to use an Async call. Here is a great link on how to use Async calls with EnableRule.
Microsoft even notes this strategy in the SDK documentation:
Consider that Microsoft sees this as the “proper way” to do things you might think that they would provide the necessary methods to complete this, that would only be half correct.
All of this works if you are on an entity form because Xrm.Page.ui.refreshRibbon() is available. Unfortunately if you are in a grid such as the one displayed below, Xrm.Page.ui is null, which means you cannot call the refreshRibbon() method.
DAGGER!!!!!!
If anyone knows a way in which to get around this please leave a comment
Hi,
ReplyDeleteUse either window.parent.Xrm.Page.ui or window.top.opener.parent.Xrm.Page.ui
This should give you handler to Page.ui
HTH
Unfortunately that doesn't work in the primary grid page. As I noted in the post the Page.ui object for the grid does not contain the Refreshribbon() function. That is only available in entity forms. I do agree thought that your solution is good while working on entity forms, thanks for posting.
ReplyDelete