Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "xrm-ex", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"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": [ |
@@ -8,7 +8,6 @@ # Xrm-Ex: Dynamics 365 Xrm Extensions | ||
A robust framework tailored for Dynamics 365 Client API. While crafted with TypeScript principles in mind, it's essential to understand that XrmEx is primarily designed for **JavaScript** usage. Our primary goal is to simplify the interaction with the formContext and the Xrm Object. By doing so, we aim to reduce the code you pen down, ensuring your codebase remains maintainable and less prone to errors. | ||
Welcome to XrmEx, a powerful TypeScript framework designed for Dynamics 365 Client API. This library is intended to ease the usage of the formContext and the Xrm Object, reducing the amount of code you have to write, thus enhancing maintainability and minimizing errors. | ||
XrmEx offers a comprehensive suite of wrappers that seamlessly integrate the Dynamics 365 Client API, ensuring developers have a smooth experience. Dive into XrmEx and elevate your productivity, channeling your energy into crafting exceptional applications. | ||
With XrmEx, you'll find a set of intuitive and robust TypeScript wrappers that bring the power of Dynamics 365 Client API into the TypeScript ecosystem in a developer-friendly way. This library is designed to boost your productivity, allowing you to focus on what matters most: creating amazing applications. | ||
## Installation | ||
@@ -21,6 +20,7 @@ XrmEx can be easily installed via npm: | ||
## Getting Started | ||
To get started with XrmEx, you'll first need to reference the library in your TypeScript project and create an early bound fields Class. | ||
Create a variable which is going to hold the instance of your fields Class. | ||
Assign the executionContext OnLoad to XrmEx.Form.formContext and create a new instance of your fields class and you're good to go: | ||
To get started with XrmEx, you'll first need to reference the library in your **JavaScript** project and create an early bound fields Class. Create a variable which is going to hold the instance of your fields Class. Assign the executionContext OnLoad to XrmEx.Form.formContext and create a new instance of your fields class and you're good to go: | ||
> **Note:** Although built with TypeScript, this library is distributed as compiled javascript and its TypeScript declaration. This means it can be used in any **javascript** file by just referencing the `XrmEx.d.ts` file. For it to work, you have to add the `XrmEx.js` file to the Form in Dynamics 365. | ||
Use the following Starter Template for your JavaScript: | ||
```js | ||
@@ -57,2 +57,17 @@ /// <reference path="node_modules/xrm-ex/src/XrmEx.d.ts" /> | ||
} | ||
/** | ||
* @param {Xrm.FormContext | Xrm.Events.EventContext} executionContext | ||
*/ | ||
export async function Init(executionContext) { | ||
if (!XrmEx) { | ||
let errorMessage = "XrmEx is not loaded. Please make sure you have XrmEx.js loaded in your form."; | ||
console.error(errorMessage); | ||
await Xrm.Navigation.openAlertDialog({ title: "Error", text: errorMessage, }); | ||
return; | ||
} | ||
XrmEx.Form.formContext = executionContext; | ||
fields = new Fields(); | ||
tabs = new Tabs(); | ||
grids = new Grids(); | ||
} | ||
/**@type {Fields()}*/ var fields; | ||
@@ -62,12 +77,13 @@ /**@type {Tabs()}*/ var tabs; | ||
/** | ||
* @param {Xrm.Events.EventContext} executionContext | ||
* @param {Xrm.FormContext | Xrm.Events.EventContext} executionContext | ||
*/ | ||
export async function OnLoad(executionContext) { | ||
fields = new Fields(); | ||
XrmEx.Form.formContext = executionContext; | ||
if (Form.IsCreate) return; | ||
fields.Firstname.Value = "Joe"; | ||
fields.Firstname.setVisible(false).setDisabled(false).setRequired(true); | ||
await Init(executionContext); //Ensures XrmEx is available by only accessing it after the OnLoad Event | ||
try { | ||
fields.Firstname.Value = "Joe"; | ||
fields.Firstname.setVisible(false).setDisabled(false).setRequired(true); | ||
} catch (error) { | ||
console.error(error); | ||
await XrmEx.openAlertDialog("Error", `Error in ${XrmEx.getMethodName()}\n` + error.message); | ||
} | ||
} | ||
@@ -74,0 +90,0 @@ ``` |
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
194905
104