New capabilities to replace unsupported methods
The following table highlights new capabilities available using the Xrm.Page that were only possible using unsupported methods in earlier versions. If you have used unsupported methods to achieve these results, you should plan to changes your scripts so that they use these supported methods after you upgrade.
| Goal | Xrm.Page method |
|---|---|
Show custom tooltips.
|
Edit the attribute description. The attribute description text will appear as a tooltip. No code required.
|
Show form and control notifications.
|
Use Xrm.Page.ui control.setNotification to set a notification message on a control and prevent save of the record until Xrm.Page.ui control.clearNotification is called to clear it.
Use Xrm.Page.ui control.setFormNotification to set a form level notification and useXrm.Page.ui.clearFormNotification to clear it.
|
Manipulate views presented for a lookup field.
|
Use the new PreSearch Event just before the search dialog opens when setting a lookup value. This event doesn’t have a user interface to set an event handler in the application, it can only be set using the Xrm.Page.ui control.addPreSearch method. Use this event with the addCustomFilter, addCustomView and setDefaultViewmethods to control the views opened when people search for a record to set as the value of a lookup field.
|
Specify whether a date control should show the time portion of the date.
|
Use Xrm.Page.ui control.setShowTime.
|
Change the labels that appear in the form.
|
Use the setLabel method for tabs, sections, controls and navigation items.
|
Hide form elements.
|
Use the setVisible method for tabs, sections, controls and navigation items.
You can use the tab.setDisplayState method to expand or collapse a tab.
|
Set focus on a form tab or navigation area.
|
Use the setFocus method available for tab, control, and navigation items.
|
Set the required level for controls.
|
Use the attribute.setRequiredLevel method.
|
Add additional functions to an event using code.
|
Use the attribute.addOnChange or entity.addOnSave methods.
|
Hiding menu items or buttons.
|
The only capability in Xrm.Page to affect the ribbon is to use the refreshRibbon method. To hide or disable controls present in the ribbon you must configure <EnableRule> (RibbonDiffXml) and <DisplayRule> (RibbonDiffXml) within <CommandDefinition> (RibbonDiffXml) elements.
These rules allow for a number of data-driven rules you can apply to hide or disable controls for a form. If your logic requires data that isn’t available from any of the rule elements provided, you can create a <CustomRule> (RibbonDiffXml) that calls a function in a JScript library. More information: Define ribbon display rules
|
No comments:
Post a Comment