-
Notifications
You must be signed in to change notification settings - Fork 1
Plugin Reference

The TypeScript Helper Utility plugin consists of two primary components: the user interface for selecting
Once you have everything set up, the plugin is fairly easy to use: load the list of the entities within the system, check entities for which scripts should be generated, and select Generate.
During the generation process, the plugin iterates over each selected entity metadata and its list attribute metadata, generating the TypeScript result based on the selected template. A default template has been provided that has been described on the wiki page Angular Template Reference. More on the syntax of the template below.
The following sections outline the UI elements and how to use them.
Most of the toolbar elements are self explanatory so we will not dive into too much detail.
- Close Tab: Standard XrmToolbox close tab
- Load Entities: Loads the entities using the active CRM connection
- Check All and Check None: Toggles all items in the list checked or unchecked
- Filter: Filter the entity list by checking whether the Display Name of the entity contains the text entered
- GitHub: Opens this wiki Home page.
In addition to the plugin toolbar, you can also access the main toolbar extensions for the wiki homepage and the issue reporting page.

Once loaded, the listview groups the entities by type, either System or Custom entity. You can also sort on each of the columns in the listview, but the list will remain grouped by System vs Custom entity.
The listview supports single selection but you can check multiple items using the checkboxes to the left. On the bottom right, you will see a summary of the items that have been checked from the main listview labeled Checked Items. This is just to make things easy to track if your system contains a large amount of entities.
The main user interface:

The toolbar provides two options for generating your script: Generate Checked or Generate Selected. Generate Checked will generate the items listed in the Checked Items list.
Note that the processing is relatively fast but a large number of selected items may take some time, depending on your machine.
If you choose Generate Selected, the plugin will generate your script for only the currently highlighted item in the list whether it's checked or not. This is just a shortcut to generate a single item without having to uncheck the rest of your list. You can also generate your script for a single item by double clicking the row in the listview.
Once generated, your results will pop up in a dialog. Here you can review the generated output to ensure everything looks good.

The Copy button will place the results on your clipboard, Save will prompt you to save to a file, while OK closes the dialog.
The Logging Results tab will show the logger output if Logging Level is not set to None.
Additional options are available to the top right of the plugin, titled Filter Settings and Project Settings. Filter Settings allow you to be more selective about which entities to load and generate:
- Entity Types: filter both on initial load of the entities from CRM and during processing. Either System Only, Custom Only or Both.
-
Entity Filters: Additional filters on which entities to process. This is a collection of filter criteria that allow you to specify a
Filter Matchrule andFilter Text. You can choose aFilter Matchof exact match, Contains, Begins/Ends with, or a regular expression. The matching is case insensitive.

-
Attribute Filters: Attribute filters operate exactly like Entity Filters. They might be more useful, such as if you wish to exclude all attributes of a particular publisher. For example, you can filter with a
Filter Textofadx_and aFilter MatchofStartsWithto exclude all Adx portal attributes. A default set of system attributes have been added that we thought might be helpful.
The Project Settings allow you to specify some additional output values and control processing.
- Logging Level: Outputs some detailed logging if needed for template processing. This can be handy if you are creating your own template
-
Module Name: Default module name output in your
Xrm.ts - Module Notes: Allows for a short description to be included with the Module name
- Retrieve As If Published: Flag indicating passed to the SDK call when retrieving the entity metadata
- Script Template: The current template that will be applied when generating the script. On load of the plugin, the default template is downloaded into the plugin folder. You can change this template if you have updates and the plugin will use your updates on the next generate run.
NOTE: If you make updates to the script template, be sure to save it in a safe location so it will not be overwritten!
The wiki page Template Reference provides an overview of the template syntax and a list of all Entity and Attribute Metadata properties available within your script.