Comparing version 1.0.16 to 1.0.17
{ | ||
"name": "xrm-ex", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "Xrm-Ex is a TypeScript framework that simplifies the usage of Dynamics 365 Client API. It provides intuitive wrappers for formContext and Xrm Object, helping developers reduce the amount of code, increase maintainability, and decrease errors. Ideal for developers looking to leverage the power of Dynamics 365 Client API within the TypeScript ecosystem.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -63,7 +63,5 @@ # Xrm-Ex: Dynamics 365 Xrm Extensions | ||
var YourNamespace = YourNamespace || {}; | ||
YourNamespace.ContactFunctions = { | ||
/**@type {Fields()}*/ fields: null, | ||
/**@type {Tabs()}*/ tabs: null, | ||
/**@type {Grids()}*/ grids: null, | ||
Fields: class Fields { | ||
YourNamespace.Contact = YourNamespace.Contact || {}; | ||
(function (Self) { //Only properties assigned to the Self object will be exposed to the global scope | ||
class Fields { | ||
Firstname = new XrmEx.TextField("firstname"); | ||
@@ -83,4 +81,4 @@ Customer = new XrmEx.LookupField("parentcustomerid"); | ||
); | ||
}, | ||
Tabs: class Tabs { | ||
} | ||
class Tabs { | ||
General = new XrmEx.Tab("tab1", { | ||
@@ -94,14 +92,19 @@ Section1: new XrmEx.Section("section1"), | ||
}); | ||
}, | ||
Grids: class Grids { | ||
} | ||
class Grids { | ||
ContactSubgrid = new XrmEx.GridControl("Test"); | ||
}, | ||
} | ||
/**@type {Fields()}*/ var fields; | ||
/**@type {Tabs()}*/ var tabs; | ||
/**@type {Grids()}*/ var grids; | ||
/** | ||
* @param {Xrm.FormContext | Xrm.Events.EventContext} executionContext | ||
*/ | ||
OnLoad: async function OnLoad(executionContext) { | ||
await this.Init(executionContext); //Ensures XrmEx is only accessed after the OnLoad Event | ||
Self.OnLoad = async function OnLoad(executionContext) { | ||
await Init(executionContext); //Ensures XrmEx is only accessed after the OnLoad Event | ||
try { | ||
fields.Firstname.Value = "Joe"; | ||
fields.Firstname.setVisible(false).setDisabled(false).setRequired(true); | ||
fields.Firstname.setVisible(true).setDisabled(true).setRequired(false); | ||
await XrmEx.openAlertDialog("Success", "Xrm works."); | ||
} catch (error) { | ||
@@ -111,7 +114,7 @@ console.error(error); | ||
} | ||
}, | ||
}; | ||
/** | ||
* @param {Xrm.FormContext | Xrm.Events.EventContext} executionContext | ||
*/ | ||
Init: async function Init(executionContext) { | ||
async function Init(executionContext) { | ||
if (!XrmEx) { | ||
@@ -124,7 +127,8 @@ let errorMessage = "XrmEx is not loaded. Please make sure you have XrmEx.js loaded in your form."; | ||
XrmEx.Form.formContext = executionContext; | ||
fields = new this.Fields(); | ||
tabs = new this.Tabs(); | ||
grids = new this.Grids(); | ||
fields = new Fields(); | ||
tabs = new Tabs(); | ||
grids = new Grids(); | ||
} | ||
}; | ||
})(YourNamespace.Contact); | ||
``` | ||
@@ -272,5 +276,5 @@ ## Documentation | ||
```js | ||
let filterFunction = function filterFunction(executionContext: Xrm.Events.EventContext) { | ||
let filterFunction = function filterFunction(executionContext) { | ||
let formContext = executionContext.getFormContext(); | ||
let customer: Xrm.Attributes.LookupAttribute = formContext.getAttribute("parentcustomerid"); | ||
let customer = formContext.getAttribute("parentcustomerid"); | ||
customer.controls.forEach((c) => { | ||
@@ -284,3 +288,3 @@ c.addCustomFilter( | ||
}; | ||
let customer: Xrm.Attributes.LookupAttribute = formContext.getAttribute("parentcustomerid"); | ||
let customer = formContext.getAttribute("parentcustomerid"); | ||
customer.controls.forEach((c) => c.addPreSearch(filterFunction)); | ||
@@ -287,0 +291,0 @@ customer.controls.forEach((c) => c.removePreSearch(filterFunction)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
204823
423