Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "xrm-ex", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"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": [ |
@@ -13,2 +13,8 @@ # Xrm-Ex: Dynamics 365 Xrm Extensions | ||
## Installation | ||
XrmEx can be easily installed via npm: | ||
```shell | ||
npm install xrm-ex | ||
``` | ||
## Getting Started | ||
@@ -19,32 +25,49 @@ To get started with XrmEx, you'll first need to reference the library in your TypeScript project and create an early bound fields Class. | ||
```typescript | ||
/// <reference path="XrmEx.ts" /> | ||
let Form = XrmEx.Form; | ||
```js | ||
/// <reference path="node_modules/xrm-ex/src/XrmEx.d.ts" /> | ||
class Fields { | ||
Firstname = new XrmEx.Field("firstname"), | ||
Lastname = new XrmEx.Field("lastname") | ||
}; | ||
var fields: Fields; | ||
export async function OnLoad(executionContext:Xrm.Events.EventContext){ | ||
fields = new Fields(); | ||
XrmEx.Form.formContext = executionContext; | ||
Firstname = new XrmEx.TextField("firstname"); | ||
Customer = new XrmEx.LookupField("parentcustomerid"); | ||
DoNotEmail = new XrmEx.BooleanField("donotemail"); | ||
Birthday = new XrmEx.DateField("birthdate"); | ||
PreferredContactMethod = new XrmEx.OptionsetField( | ||
"preferredcontactmethodcode", | ||
{ | ||
Any: 1, | ||
Email: 2, | ||
Phone: 3, | ||
Fax: 4, | ||
Mail: 5, | ||
} | ||
); | ||
} | ||
``` | ||
You can then use the library to interact with the Dynamics 365 Client API. Here's a simple example: | ||
```typescript | ||
export async function OnLoad(executionContext:Xrm.Events.EventContext){ | ||
fields = new Fields(); | ||
XrmEx.Form.formContext = executionContext; | ||
class Tabs { | ||
General = new XrmEx.Tab("tab1", { | ||
Section1: new XrmEx.Section("section1"), | ||
Section2: new XrmEx.Section("section2"), | ||
}); | ||
Details = new XrmEx.Tab("tab2", { | ||
Section1: new XrmEx.Section("section1"), | ||
Section2: new XrmEx.Section("section2"), | ||
}); | ||
} | ||
class Grids { | ||
ContactSubgrid = new XrmEx.GridControl("Test"); | ||
} | ||
/**@type {Fields()}*/ var fields; | ||
/**@type {Tabs()}*/ var tabs; | ||
/**@type {Grids()}*/ var grids; | ||
/** | ||
* @param {Xrm.Events.EventContext} executionContext | ||
*/ | ||
export async function OnLoad(executionContext) { | ||
fields = new Fields(); | ||
XrmEx.Form.formContext = executionContext; | ||
if(Form.IsCreate) return; | ||
if (Form.IsCreate) return; | ||
fields.Firstname.Value = "Joe"; | ||
fields.Lastname.setVisible(false).setDisabled(false).setRequired(true); | ||
fields.Firstname.Value = "Joe"; | ||
fields.Lastname.setVisible(false).setDisabled(false).setRequired(true); | ||
} | ||
``` | ||
## Installation | ||
XrmEx can be easily installed via npm: | ||
```shell | ||
npm install --save xrm-ex | ||
``` | ||
@@ -51,0 +74,0 @@ ## Documentation |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
193740
88
0