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:
- Navigate to Settings | Solutions and open the HIMBAPAutoService solution.
- Click on Web Resources | New and fill in the following details:
- Name: CustomerLibrary.js
- Display Name: CustomerLibrary.js
- Type: Script (Jscript)
- Click on Text Editor and use the following script:
var HIMBAP = window.Sdk || {};(function() { this.customertypeOnChange = function(executionContext) ...