Dashboard Logic

 

You will use a Dashboard logic when you need to:

  • Present data in the form of tables or charts.

  • Create a set of action buttons.

Such content can be presented:

  • On a dashboard page.

  • In an embedded dashboard (dashboard included in other dashboard).

  • In a dashboard widget (dashboard included as a tab on detail page) (see Detail Page Layout).

Logic API

  • Logic Nature: default

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Input Generation - To define the dashboard filters (i.e., the input fields).

      • This is used only for regular dashboards, i.e., those displayed on the Dashboards page. The embedded dashboards or dashboards on document detail page do not have any filters of their own, so you’re not using this execution there.

    • Standard - To calculate the results (e.g., prices) and build the matrix tables or high-charts. Used for all types of dashboards, i.e.:

      • regular dashboard

      • embedded dashboard

      • dashboard on document detail page

  • Information provided to the logic

    • in Input Generation execution:

      • nothing

    • in Standard execution:

      • input[]

        • For regular dashboard - contains the values of all filter inputs set by user.

        • For embedded dashboard - contains the values of parameters passed from the "main" dashboard.

        • For dashboard on document detail page - nothing.

      • api.currentItem()

        • For regular dashboard - nothing.

        • For embedded dashboard - nothing.

        • For dashboard on document detail page - the object (provided as a Map), for which you render the dashboard.

  • Expected logic execution outcome

    • From Input Generation mode execution - input field definitions.

    • From Standard mode execution - Every visible element can return one of the CalculationResultType (note, that not all types listed there are supported by dashboards). Each element result will render in a separate portlet (with the exception of simple result values).

      • ResultMatrix - A table with data. It can also have actionable/clickable data values.

      • ResultHighchart - A chart made via Highcharts. It can also have actionable/clickable data values.

      • ResultHighmap - A geographical map chart made with Highcharts. It can also have actionable/clickable data values.

      • ChartBuilderResult - One of the standard charts from the Analytics module. It can also have actionable/clickable data values.

      • DashboardApi - To embed another dashboard (in a portlet of the current dashboard).

      • DashboardController - To add various action buttons or HTML-like text.

      • SystemPortlet - To add some of the portlets, which are commonly used on Home page (home dashboard).

      • number/string/date - Those will appear in a special KPI portlet.

      • ResultPAQuery (experimental) - A table with data from Datamart/Datasource. The data will be loaded to the portlet asynchronously from result of the query built via call of buildQuery() method

Configuration

  • For regular and embedded dashboards - This logic must be referred from the Dashboard configuration - (entity Dashboard), which is set up on page Administration › Dashboards.

  • For a dashboard on document detail page - Set in the configuration field of the document type (e.g., see field configuration on Quote Type).

Common Logic Structure

  1. Build input fields definitions.

  2. Abort on input generation.

  3. Collect all the data needed for the dashboard.

  4. Build the tabular or chart representation of the data and return them as element results.

We have introduced the new field fromPreference to differentiate if the changes come from preference or user manual input. For more information see Interactive Forms - Configurators.

Code Sample

Found an issue in documentation? Write to us.

Â