Custom Form Logic

Since version 9.0

You will use a Custom Form logic when you need to:

  • Create input fields for the Custom Form.

  • Calculate results and show them:

    • In the Calculation Results section of the Custom Form.

    • On Custom Header, in the form of charts and tabular data. Note that this applies only to the standalone Custom Form.

  • Update header fields (e.g., attributeX).

  • Hide the out-of-the-box

    • buttons

The Custom Form can be then presented:

  • As a standalone page, accessible via menu item placed in one of the menus.

  • As an embedded sub-page, accessible as a tab of another document (Quote, standalone Custom Form).

Logic API

  • Logic Nature: customFormHeader

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Standard - Standard execution of this header logic is done 2x during form recalculation, the executions being called phases. They have different purpose, so you must distinguish between those executions in the code by checking, which execution it is right now:

      • pre-phase - This execution is used to create input fields on header, and hide out-of-the-box buttons.

      • post-phase - The other execution is called post-phase - to calculate results and store and present them on calculation results of the header or on the Custom Header.

  • Information provided to the logic:

    • Binding variables:

      • input: [Map] - Contains the values provided by the user to the input fields.

      • customFormProcessor: [CustomFormCollectionBuilder], provides information about the phase and also can add the inputs and outputs to the Custom Form object.

    • api.currentItem(): [Map] - The content of the Custom Form itself, provided as a Map.

    • Manual overrides - In case you have results which are overridable, the system must supply the values provided by the user.

  • Expected logic execution outcome:

    • Pre-phase execution

      • Definition of input fields - via the customFormProcessor.addOrUpdateInput().

    • Post-phase execution

      • Calculation results - via the customFormProcessor.addOrUpdateOutput().

      • Custom Header - customFormProcessor.addOrUpdateOutput().

      • Set attributeX field values - via customFormProcessor.updateField("attribute1", "value").

      • Hide out-of-the-box buttons - via customFormProcessor.setRenderInfo().

      • Raise critical Alert - If the logic creates at least one critical alert, it’s considered as an exception, and the process (e.g., submission) will stop.

    • Note that the results of the logic elements are not stored nor displayed anywhere (with the exception when testing the logic in Studio).

Found an issue in documentation? Write to us.

Â