ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 139 - PL-400 discussion

Report
Export

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();

Answers
A.

gridContext.refresh();

B.

formContext.ui.refreshRibbon(refreshAll);

Answers
B.

formContext.ui.refreshRibbon(refreshAll);

C.

formContext.data.refresh(save).then(successCallback, errorCallback);

Answers
C.

formContext.data.refresh(save).then(successCallback, errorCallback);

D.

formContext.ui.refreshRibbon();

Answers
D.

formContext.ui.refreshRibbon();

E.

formContext.getControl(arg).refresh();

Answers
E.

formContext.getControl(arg).refresh();

Suggested 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

asked 05/10/2024
Carlos Periterra
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first