JS Constant Generator

This XrmToolBox tool allows you to generate constants for the table and column logic names as well as enums for choice option values (developed by Narendra Magare).

When we apply business logic using client scripting in model-driven apps using JavaScript, we need to specify the logical name of the table/columns in getAttribute(), getControl(), Xrm.WebApi requests, etc. We also need to specify the choice option values to check or set the value of the choice columns and it is error-prone to type those logical names and choice option integer values manually in the code.
To avoid typo errors for logical names during JavaScript development, you can use this tool to generate JavaScript files for selected tables and columns.
  • Tool Information
  • Functionalities
    • Generate a JavaScript file with constant strings for table (entity) logical names (Fig. 1, Pt. 5) (Fig. 2)
      • Load the list of tables from the connected environment (Fig. 1, Pt. 1)
      • Select individual or all tables from the list (Fig. 1, Pt. 2)
      • Specify the namespace for the generated entity JavaScript file (Fig. 1, Pt. 3)
    • Generate a JavaScript file with constant strings for column (attribute) logical names and enums for choice (option set) values (Fig. 1, Pt. 10) (Fig. 3)
      • Uncheck all and select only one table to generate the attribute JavaScript file (Fig. 1, Pt. 6)
      • Load the columns from the selected table (Fig. 1, Pt. 8)
      • Select individual or all columns from the list (Fig. 1, Pt. 9)
      • Specify whether or not to include enums for choice values in the attribute JavaScript file (Fig. 1, Pt. 7)
      • Specify the namespace for the generated attribute JavaScript file (Fig. 1, Pt. 3)
      • Specify the prefix of the generated attribute JavaScript file (Fig. 1, Pt. 4)
  • Similar Tools
    • _n.ConstantsExtractor

Fig. 1 - JS Constant Generator


Fig. 2 - Entity JavaScript File


Fig. 3 - Attribute JavaScript File

This is part of the #TooLDR series where I test and review the tools for Power Platform. You can check out the information for the other tools on this page.

Comments

Popular Posts