Which two code segments can you use?
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.
Which two code segments can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.
A . gridContext.refresh();
B . formContext.ui.refreshRibbon(refreshAll);
C . formContext.data.refresh(save).then(successCallback, errorCallback);
D . formContext.ui.refreshRibbon();
E . formContext.getControl(arg).refresh();
Answer: B,D
Explanation:
B: formContext.ui.refreshRibbon(refreshAll);
Causes the ribbon to re-evaluate data that controls what is displayed in it.
Indicates whether all the ribbon command bars on the current page are refreshed. If you specify false, only the page-level ribbon command bar is refreshed. If you do not specify this parameter, by default false is passed.
Remarks: This function is typicaly used when a ribbon (RibbonDiffXml) depends on a value in the form. After your code changes a value that is used by a rule, use this method to force the ribbon to re-evaluate the data in the form so that the rule can be applied.
D: If role is there – just refresh the ribbon to see the button
if (isButtonEnabled) {
formContext.ui.refreshRibbon();
}
},
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/refreshribbon
https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/302049/show-hide-button-bases-on-different-criteria/871674
Latest PL-400 Dumps Valid Version with 171 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund