XRM / Dynamics CRM Example Code Repo
- Examples 1. and 2. using Webpack and TypeScript for Form Library development.
- Example 1. Shows how you can combine entity form and ribbon scripts (per entity) into one file (with all dependencies included) by using Webpack as build tool.
- Example 2. Shows how you can combine all entity form scripts into one file and all entity ribbon scripts into one file (with all dependencies included) by using Webpack as build tool.
- more to come ...
- install node with npm included.
- run
npm install
from the root folder to install all npm dependencies (i.e. Webpack, TypeScript, etc.).
-
Shows how you can combine entity form and ribbon scripts (per entity) into one file (with all dependencies included) by using Webpack as build tool.
-
run
npm run example_1
from the root folder to build. The build output can be found in thedist\example_1
folder.Example output:
- mdocter.account.js and mdocter.account.js.map (=sourcemap)
- mdocter.contact.js and mdocter.contact.js.map (=sourcemap)
- NB. *.js files are minified with Webpacks Uglify Js plugin.
Usage example on the Account form:
- Add the build output *.js files as JavaScript web resources to some solution;
- Open the Account Main/Primary form in the CRM Form Editor;
- Open the 'Form Properties' by clicking the button in the ribbon;
- Add the
mdocter.account.js
file as a form library to the form; - In the 'Event Handlers' section, add an
OnLoad
event by clicking the plus-button above the event handlers subgrid; - Select the
mdocter.account.js
library and addmdocter.formjs.account.onLoad
as Function name.
-
Shows how you can combine all entity form scripts into one file and all entity ribbon scripts into one file (with all dependencies included) by using Webpack as build tool.
-
run
npm run example_2
from the root folder to build. The build output can be found in thedist\example_2
folder.Example output:
- mdocter.form.js and mdocter.form.js.map (=sourcemap)
- mdocter.ribbon.js and mdocter.ribbon.js.map (=sourcemap)
- NB. *.js files are minified with Webpacks Uglify Js plugin.
Usage example on the Account form:
- Add the build output *.js files as JavaScript web resources to some solution;
- Open the Account Main/Primary form in the CRM Form Editor;
- Open the 'Form Properties' by clicking the button in the ribbon;
- Add the
mdocter.form.js
file as a form library to the form; - In the 'Event Handlers' section, add an
OnLoad
event by clicking the plus-button above the event handlers subgrid; - Select the
mdocter.form.js
library and addmdocter.formjs.account.onLoad
as Function name.
Author: Maarten Docter (@mdocter)