PL-400 · Question #156
An organization uses Dynamics 365 Sales. You plan to add a custom button to the app ribbon. You need to ensure that the button displays only when conditions specified by business rules are met…
The correct answer is B. formContext.ui.refreshRibbon(refreshAll); D. formContext.ui.refreshRibbon(). To make a ribbon button conditionally visible based on business rules, the ribbon's enable/display rules must be re-evaluated. This is triggered by calling formContext.ui.refreshRibbon(). Option D - formContext.ui.refreshRibbon() - calls the refresh with no argument…
Question
Options
- AgridContext.refresh();
- BformContext.ui.refreshRibbon(refreshAll);
- CformContext.data.refresh(save).then(successCallback, errorCallback);
- DformContext.ui.refreshRibbon();
- EformContext.getControl(arg).refresh();
How the community answered
(49 responses)- A12% (6)
- B80% (39)
- C4% (2)
- E4% (2)
Explanation
To make a ribbon button conditionally visible based on business rules, the ribbon's enable/display rules must be re-evaluated. This is triggered by calling formContext.ui.refreshRibbon(). Option D - formContext.ui.refreshRibbon() - calls the refresh with no argument, re-evaluating all ribbon rules. Option B - formContext.ui.refreshRibbon(refreshAll) - calls it with true, forcing a full refresh of all ribbon elements including those that may be cached. Both are valid ways to trigger ribbon rule re-evaluation. Option A (gridContext.refresh()) refreshes a grid, not the ribbon. Option C (formContext.data.refresh(save)) saves/refreshes form data. Option E (formContext.getControl(arg).refresh()) refreshes a specific form control, not the ribbon.
Community Discussion
No community discussion yet for this question.