Skip to content

Client Side

INFO

You can refer to Microsoft's Client API Reference for model-driven apps documentation

General

  • Write separate files for main form(s) and ribbon
  • Web resources are implemented as Javascript class

Example:

js
class Account {
  constructor() {
    console.log("loaded rtm_account.js");
  }
  onload(executionContext) {
    // onload code
    const formcontext.addOnSave(this.onsave)
  }
  onsave(executionContext) {
    // onsave code
  }
  // etc...
}
window.account = new Account();

Please read the Client API documentation to learn how to define event handlers.

CRM Definitions

TypeTemplateDisplay NameLogicalnameJS Class Name
Mainrtm_<entityname>.jsrtm_account.jsrtm_account.jsAccount
Ribbonrtm_<entityname>_ribbon.jsrtm_account_ribbon.jsrtm_account_ribbon.jsAccountRibbon

Working with Fiddler

INFO

The community-trusted free Windows-only tool that logs HTTP(s) network traffic.

We will be using Fiddler Classic. You can get it Here

Configuration

Go to Tools > Options > Https

  • ☑ Capture HTTPS CONNECTs
  • ☑ Decrypt HTTPS traffic
  • Set Perform Decryption only for the following hosts:
*.crm4.dynamics.com

** Fiddler will ask you to trust it's certificate. So trust it 😊

Fiddler - Auto Responder

INFO

The Fiddler Auto Responder is a powerful feature in the Fiddler web debugging tool that allows you to create rules to automatically respond to HTTP requests with custom responses

In the right side of fiddler there are tabs of its tools goto AutoResponder and check the following settings:

  • ☑ Enable Rules
  • ☑ Unmatched requests passthrough

Rules

This example is for the account.js script

Add a new rule

  • Set the url expression to: regex:(?inx).*/webresources/account.js
  • Set the action to: C:\your\local\path\to\account.js

** you may need to clear the browser's cache to force it to refetch the script and use the one that fiddler's Auto Responder provides