Creating web resources

We can use script web resources to store our JavaScript libraries. Once created, they can be reused in multiple entities. Let's say we want to hide the manager lookup on a customer form based on the customer type. We only want to show the manager lookup if the customer type is a customer. Let's follow these steps to create web resources for our script:

  1. Navigate to Settings | Solutions and open the HIMBAPAutoService solution.
  2. Click on Web ResourcesNew and fill in the following details:
  • Name: CustomerLibrary.js
  • Display Name: CustomerLibrary.js
  • Type: Script (Jscript)
  1. Click on Text Editor and use the following script:
var HIMBAP = window.Sdk || {};(function() { this.customertypeOnChange = function(executionContext) ...

Get Implementing Microsoft Dynamics 365 Customer Engagement now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.