Skip to content

mdocter/xrm-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xrm-examples

XRM / Dynamics CRM Example Code Repo

Contains the following examples

  • 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 ...

Prerequisites

  • install node with npm included.
  • run npm install from the root folder to install all npm dependencies (i.e. Webpack, TypeScript, etc.).

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.

  • run npm run example_1 from the root folder to build. The build output can be found in the dist\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 add mdocter.formjs.account.onLoad as Function name.

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.

  • run npm run example_2 from the root folder to build. The build output can be found in the dist\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 add mdocter.formjs.account.onLoad as Function name.

Author: Maarten Docter (@mdocter)

About

XRM / Dynamics CRM Example Code Repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published