It has been a while now that Microsoft Dialog boxes have been deprecated. Dialogs were a good alternative for a Functional Consultant to create an interactive data entry form. After the deprecation th...
Ribbon Enable Rules using Asynchronous processing
This can be demonstrated with an example that enables or disables a ribbon button on the Account entity if the account has any contacts.
Problematic code example:
We will need a Boolean variable called buttonProcessing with a scope outside the method that will store the actual value to be returned to the Enable Rule. For safety, this variable can have an initial value of false. This is so that a ribbon button is not enabled while the asynchronous call is awaiting its response.
Corrected code example:
This ribbon button is now enabled or not based a value set during an asynchronous callback.
There is a performance consideration that we should take into account when calling refreshRibbon. All buttons in the form ribbon will be refreshed, so this may have an impact if a lot of buttons have been added to form. Fortunately, if the above pattern is followed, the logic behind each custom Enable Rule will be executed only once per form load.
To read more about the refreshRibbon method, please see https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/refreshribbon
More relevant news
How to financially process transfer order charges within Cloud4Commodities27 January 2021
For transfer order scenarios where you ship items from one warehouse to another, you want to add the calculated charges to the transfer order through miscellaneous charges. The posting of charges on t...
How to manage expected operational cost versus the actual costs received16 October 2020
In an earlier blogpost (How to manage additional cost coming with a trade deal) we highlight the automatic calculation of expected operational cost during trade capture. Within this post we highl...