Which two code segm...
 
Notifications
Clear all

Which two code segments can you use? Each correct answer presents a complete solution. NOTE:

1 Posts
1 Users
0 Likes
177 Views
(@velvertonernest)
Noble Member
Joined: 2 years ago
Posts: 699
Topic starter  

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

Show Answer Hide Answer

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

   
Quote

Latest Microsoft PL-400 Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: