Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
What's new for developers in Dynamics 365 v9: Client API enhancement
1.
2.
3.
4.
5. Method Description
getDepth Returns a value that indicates the order in which this handler is
executed.
getEventArgs Returns an object with methods to manage the OnSave event.
getEventSource Returns a reference to the object that the event occurred on.
getFormContext Returns a reference to the form or an item on the form
depending on where the method was called.
getSharedVariable Retrieves a variable set using the setSharedVariable method.
setSharedVariable Sets the value of a variable to be used by a handler after the
current handler completes.
6. function displayName() {
var firstName = Xrm.Page.getAttribute("firstname").getValue();
var lastName = Xrm.Page.getAttribute("lastname").getValue();
console.log(firstName + " " + lastName);
}
old
function displayName(executionContext) {
var formContext = executionContext.getFormContext(); // get formContext
// use formContext instead of Xrm.Page
var firstName = formContext.getAttribute("firstname").getValue();
var lastName = formContext.getAttribute("lastname").getValue();
console.log(firstName + " " + lastName);
}
new
9. var gridContext = formContext.getControl("Contacts");
You can register for the OnChange, OnRecordSelect, and OnSave events using the Events tab of the
Dynamics 365 Customer Engagement page that is used to enable editable grids for an entity or a read-only
grid.
function myFunction(executionContext) { |
var formContext = executionContext.getFormContext(); // get the form context
var gridContext = formContext.getControl("Contacts");// get the grid context
var myContactsGridOnloadFunction = function () {
console.log("Contacts Subgrid OnLoad event occurred")
};
gridContext.addOnLoad(myContactsGridOnloadFunction);
}
10.
11. Namespace Description
Xrm.Device Provides methods to use native device capabilities of mobile devices.
Xrm.Encoding Provides methods to encode strings.
Xrm.Navigation Provides methods for navigating forms and items in Customer
Engagement.
Xrm.Panel Provides a method to display a web page in the side pane of
Customer Engagement form.
Xrm.Utility Provides a container for useful methods.
Xrm.WebApi Provides methods to use Web API to create and manage records
and execute Web API actions and functions.
14. Property Description
client Returns information about the client.
organizationSettings Returns information about the current
organization settings.
userSettings Returns information about the current
user settings.
15. Method Description
getAdvancedConfigSetting Returns information about the advanced configuration settings for the
organization.
getClientUrl Returns the base URL that was used to access the application.
getCurrentAppName Returns the name of the current business app in Customer Engagement.
getCurrentAppProperties Returns the properties of the current business app in Customer Engagement.
getCurrentAppUrl Returns the URL of the current business app in Customer Engagement.
getVersion Returns the version number of the Dynamics 365 Customer Engagement
instance.
isOnPremises Returns a boolean value indicating if the Customer Engagement instance is
hosted on-premises or online.
prependOrgName Prefixes the current organization's unique name to a string, typically a URL path.
16.
17. New Namespace Description
Xrm.Device Provides methods to use native device capabilities of
mobile devices.
Xrm.Encoding Provides methods to encode strings.
Xrm.Navigation Provides navigation-related methods.
Xrm.WebApi Provides properties and methods to use Web API to create
and manage records and execute Web API actions and
functions.
18. Namespace New APIs
formContext.data - OnLoad event and even handlers (addOnLoad and
removeOnLoad)
- isValid
- Updated saveOptions in the formContext.data.save
method to include a new value called saveMode to let
the onSave event handlers know why the save is
happening
- attributes collection
formContext.data.entity getEntityReference
isValid
formContext.data.entity attribute isValid
setPrecision
formContext.ui event handlers for the OnLoad event (addOnLoad and
removeOnLoad)
23. Important changes coming in Dynamics 365 Customer
Engagement
Client scripting in Customer Engagement using JavaScript
Client API Reference for Customer Engagement