Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Sourcing large data pages from a report definition

Updated on February 23, 2022

Ensure that users can quickly access up-to-date reference data in your offline-enabled mobile app, such as expense report details, by improving the synchronization process. To achieve this improvement, set the source of large data pages to a report definition.

Note: You can also source large data pages from connectors, activities, or data transforms. However, those source types require you to create a JavaScript populator function. As a best practice, source large data pages from report definitions.

For more information, see Sourcing large data pages from a connector, activity, or data transform.

Before you begin:
  1. In Dev Studio, create a report definition from which you want to source the data page.

    For more information, see Creating advanced reports.

  2. Set the datapages/addReportDefinitionToDatapage dynamic system setting to true.

    For more information, see Editing a dynamic system setting.

  1. In Dev Studio, create and configure a data type:
    1. Create a data type that you want to use for your data page.
      For more information, see Creating a data type in Dev Studio.
    2. On the Data model tab, click Add field.
    3. In the Add field to dialog box, enter the name and type of the property that you want to include in the data page.
    4. Optional: To add more properties to the data type, click Submit & add another.
      For example: For an Expense data type, add the following fields: Title, Description, Amount, Currency, and EmployeeID.
    5. After you add all properties to the data type, click Submit.
    6. Click Save.
  2. If the source of the data type is local data storage, ensure that you optimize the pyModificationDateTime and pyIsRecordDeleted properties by performing the following actions:
    1. On the Records tab, create a dedicated table for the class by clicking Configure source.
    2. In the source list, add the pyModificationDateTime and pyIsRecordDeleted properties by clicking the Plus icon and selecting the corresponding property names.
    3. Click Submit.
    4. In the Review dialog box, confirm the settings by clicking Close.
    5. Click Save.
    For more information about property optimization, see Planning for property optimization.
  3. Create the data page:
    1. In the header of Dev Studio, click CreateData ModelData Page.
    2. In the Create Data Page window, in the Label field, enter a name for the data page, for example, Expenses.
      Pega Platform automatically creates an identifier for the data page, for example, D_Expenses. Do not remove the D_ from the beginning of the name.
    3. In the Context section, specify the class and ruleset for the data page.
    4. Click Create and open.
    For more information, see Creating a data page.
  4. In the Edit Data Page window, on the Definition tab, in the Data page definition section, define the data page as follows:
    1. In the Structure list, select List.
    2. In the Object type list, select the data type that you created in step 1.
    3. In the Scope list, select the scope of the data page.
      Tip: For best performance, in the Scope list, select Node.
  5. On the Parameters tab, in the Name field, enter pyModificationDateTime.
  6. On the Definition tab, in the Data Sources section, set the report definition as the source of the data page:
    1. In the Source list, select Report definition.
    2. In the Name field, enter the name of the report definition that you created.
    3. Click Parameters.
    4. In the Parameters for window, select the Pass current parameter page check box, and then click Submit.
    For example: A mobile app developer for the uPlus company sets the ExpenseReport report definition as the source of a data page.
    Setting a report definition as the source of a data page
    In Dev Studio, the user adds the ExpenseReport report definition as the source of a large data page and configures its parameters.
  7. In the Data Sources section, open the report definition by clicking the Open icon next to the Name list.
  8. On the Report definition tab, ensure that the data page recognizes new or altered records by adding the pyModificationDateTime property and by defining a corresponding filter:
    1. On the Query tab, in the Edit columns section, click Add column.
    2. In the Column source list, select .pyModificationDateTime.
      The pyModificationDateTime property registers the date and time of the most recent changes in the data source records. The changes include adding, updating, or deleting data.
    3. On the Parameters tab, in the Name field, enter pyModificationDateTime.
    4. In the Data type list, select Date Time.
    5. On the Query tab, in the Edit filters section, add a filter condition and specify the following settings:
      • Condition - A
      • Column source - .pyModificationDateTime
      • Relationship - greater than
      • Value - Param.pyModificationDateTime
    Result: During the first synchronization with the server, the app receives all data regardless of the value of the pyModificationDateTime property. The following synchronizations fetch only new or altered records based on the pyModificationDateTime column.
  9. Ensure that the data page recognizes deleted records by adding the pyIsRecordDeleted property to the report definition:
    1. On the Query tab, in the Edit columns section, click Add column.
    2. In the Column source list, select .pyIsRecordDeleted.
      The pyIsRecordDeleted property keeps track of deleted records.
    Result: After the first synchronization with the server, each following synchronization identifies records that are marked as deleted on the server and instructs Pega Mobile Client to delete corresponding records from the database.
  10. Click Save.
  11. Optional: To configure a refresh strategy for data pages, on the Load Management tab, in the Refresh strategy section, define the parameters for refreshing the data page.
    For more information, see Configuring the refresh strategy for data pages.
    Note: Do not use the Do Not Reload When refresh strategy with the pyModificationDateTime time stamp.
  12. Optional: To bind the data with data from a different class, on the Data Access tab, in the Class joins section, perform the following actions:
    1. Click Add class join.
    2. In the Prefix field, declare a class join by entering the name of the corresponding data page.
      Note: You can add only one join for a specific data page. Any other class joins are ignored.
    3. Optional: To apply a filter to the condition, click Edit conditions.
    4. Click Save.
    For example: A mobile app developer for the uPlus company creates an offline-enabled mobile app for submitting expense reports. The developer wants the expense reports to contain information about the employees that submit the reports, such as name and contact information. To achieve this, the developer binds the D_Expenses data page with the D_Employees data page that contains employee data.
What to do next: Declare the data page as large. For more information, see Declaring a data page as large.
  • Previous topic Best practices for configuring large data pages in offline-enabled mobile apps
  • Next topic Sourcing large data pages from a connector, activity, or data transform

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us