Creating JavaScript Modules

You create JavaScript Modules to customize JavaScript functions that you want to use in your visual projects.

About this task

To create a JavaScript Module, do the following actions:


  1. From the main menu, select File > New > Other to open the New wizard.
  2. In the New wizard, expand QMF Objects folder and select JavaScript Module.
  3. Click Next to open the New JavaScript Module wizard.
  4. Specify the name for the JavaScript Module in the Name field and click Finish to open the JavaScript Module editor.
  5. Enter JavaScript functions in the editor.
  6. Start each function with the keyword 'function'. For details about syntax, see Syntax for custom functions.
  7. Add a comment before each function.

    The application interprets this comment as the description of the function.

  8. Optional: Define a category to which you add a new function.

    Use the '@category' tag in the comments to add it. If there is no such category, it will be created.

    Note: The following categories already exist in the application:
    • Columns
    • Aggregation
    • Conversion
    • Date and Time
    • Information
    • Logical
    • Math and Trigonometric
    • Misc
    • Text
    • Objects
  9. To verify the correctness of the JavaScript functions that you entered in the editor, click the Check JavaScript syntax and structure JavaScript validation button toolbar button.
  10. After you entered the required JavaScript functions, save the JavaScript Module to a repository or a file.