Displaying promoted and user-defined fields in views and reports

You can modify specific views to display any promoted stock field and user-defined field .

Views modified in this way behave as follows:

Component Behavior
Edit form panels Display all promoted and user-defined fields from the main table
Grid panels Display all promoted and user-defined fields from the main table. Users can hide some or all of these fields using the Select Fields dialog
SVG 2D drawing panels Allow users to highlight and/or display labels on the floor plan based on any promoted or user-defined field

Data sources

Add the <promotedFields> tag to the data source:

<dataSource id="defaultDataSource"> <table name="rm"/> <field name="bl_id"/> <field name="fl_id"/> <field name="rm_id"/> <promotedFields table="rm"/> </dataSource>

The table attribute is mandatory. It must match the main table of the data source.

If the data source contains a custom SQL query, add the ${sql.getPromotedFieldsForTable} expression to it:

<dataSource id="sqlDataSource"> <table name="rm"/> <field name="bl_id"/> <field name="fl_id"/> <field name="rm_id"/> <promotedFields table="rm"/> <sql dialect="generic"> SELECT bl_id,fl_id,rm_id ${sql.getPromotedFieldsForTable('rm')} FROM rm </sql> </dataSource>

Note : There is no comma before the expression.

Grid and form panels

Add the <promotedFields> tag to the panel:

<panel type="grid" id="defaultGrid" dataSource="defaultDataSource" layoutRegion="row1col1"> <title>Grid with user-defined fields</title> <field name="bl_id"/> <field name="fl_id"/> <field name="rm_id"/> <promotedFields table="rm"/> </panel>

The <promotedFields> tag must be present in both the panel and the data source.

Example : schema/ab-products/solutions/parts/grid/ab-ex-report-grid-user-defined-fields.axvw