Create a Page Expression Data Form

Expression data forms are View Data Forms that are included on a page for the purposes of providing a field value. An expression data form is not displayed by the page.

Creating a Page Expression Data Form is the same as creating any other View Data Form, with the exception that the View Data Form is used by a page for expressions. A single View Data Form for use in expressions can be indicated in the ExpressionDataFormID attribute in the root element. Multiple View Data Forms for use in expressions can be indicated in a PageExpressionForms element within the spec.

ExpressionDataFormID Attribute (Page Spec)

You can specify a View Data Form to use with page expressions in the ExpressionDataFormID attribute of a PageDefinitionSpec element. You can then use the values from the fields on the View Data Form in expressions. In the example that follows, a field from the View Data Form is used in the page header's caption.

<PageDefinitionSpec
  xmlns="bb_appfx_pagedefinition"
  xmlns:common="bb_appfx_commontypes"
  ID="9a36ff56-5c9c-4296-aa50-8dff8d8a35bd"
  Name="Example Page - Page Expression Example (custom)"
  Description="A page for displaying information about example records"
  Author="Technical Training"
  ContextRecordType="Example (custom)"
  ExpressionDataFormID="6673f03d-3b3e-4d42-9975-d31e90e41d93">

  <PageHeader Caption="= Page.Fields!SHORTNAME" />

  <SummarySection ID="FED8B53D-EABD-403E-8830-88254CCFD5BC" Caption="Summary">
    <DataForm ID="7d382c51-7b83-4c96-b878-6c6056d51364"/>
  </SummarySection>

</PageDefinitionSpec>

PageExpressionForms Element (Page Spec)

You can specify multiple View Data Form to use with page expressions in the PageExpressionForms element in a PageDefinitionSpec element. You can then use the values from the fields on the View Data Form in expressions. PageExpressionForms is used to supply additional View Data Forms for page expressions. If PageExpressionForms is used, the must also be a value for ExpressionDataFormID.

In the following spec, fields from two View Data Forms are available to page expressions. The first View Data Form is specified in the ExpressionDataFormID attribute and the second View Data Form is specified in the PageExpressionForms element. In the example that follows, a field from the View Data Form is used in the page header's caption.

Note: When View Data Forms have the same field name, the name is only listed once in the Shell Design / Design Mode user interface.

<PageDefinitionSpec
  xmlns="bb_appfx_pagedefinition"
  xmlns:common="bb_appfx_commontypes"
  ID="7846f532-6796-4dfe-b67d-7062bea1507e"
  Name="Example Page - Another Page Expression Example (custom)"
  Description="A page for displaying information about example records"
  Author="Technical Training"
  ContextRecordType="Example (custom)"
  ExpressionDataFormID="7d382c51-7b83-4c96-b878-6c6056d51364">

  <PageHeader Caption="= Page.Fields!LONGNAME" />

  <SummarySection ID="00429473-9255-40EC-87F5-E52DEC447B49" Caption="Summary">
    <DataForm ID="7d382c51-7b83-4c96-b878-6c6056d51364"/>
  </SummarySection>

  <PageExpressionForms>
    <PageExpressionForm DataFormInstanceID="6673f03d-3b3e-4d42-9975-d31e90e41d93"/>
  </PageExpressionForms>

</PageDefinitionSpec>

Shell Design

  1. From Add a pagePageExpressionDataForms, click the ellipses. The Page expression forms screen appears.

  2. From the View forms grid, search for and select the View Data Forms to use with page expressions.

  3. Click OK.

    You can now use fields from this form in page expressions. For example from Add a pageAppearanceCaption, you can click the ellipses. The Caption screen appears.

  4. From Available fields, under Page, you can select the fields to use in the expression for the caption. You can double-click the field or highlight the field and click the arrow button to include it in the expression.