Skip to main content

Reference

Tips for building Virtual Relations

Tips on exceeding governor limits

If the feature does not work due to exceeding the Salesforce Governor Limits, considersetting as follows.

  • Specify the same field both for Join Criteria / Filter Criteria and for the sort condition of Output Conditions.

  • If too many records are output, set Join Criteria / Filter Criteria.

  • Instead of specifying the OR condition in Conditional Expression of Join Criteria / Filter Criteria, use Salesforce formula field that represents the same criterion.

Tips for improving performance

In order to improve performance, consider specifying a custom index for the field in Join Criteria / Filter Criteria.

Reference value for consumed resource

Refer to the following examples for the SOQL query issued, the number of records retrieved, and the CPU time, at the time of outputting forms with Virtual Relation.

The values shown are for reference only and do not guarantee the performance in your environment.

Example of outputting from objects in multiple layers

Records in child object, grandchild object, and great-grandchild object are related with one record in base object and are output.

  • Object structure

    illust_resource_deepMulti.png
  • Number of fields output from each object

    Objects (API names of Virtual Relation are in parentheses)

    Number of fields

    Account

    17

    Contact

    6

    Opportunity (primeOpportunity__v)

    7

    Account (child__v)

    16

    Contact (ceo__v)

    2

  • Numbers of SOQL queries issued and records retrieved

    • Total number of SOQL queries issued

      12

    • Total number of records retrieved

      45

  • CPU time

    1,708 milliseconds

Example of outputting a large number of records

Records in child object are related with 200 records in base object and are output.

  • Object structure

    illust_resource_simple.png
  • Number of fields output from each object

    Objects (API names of Virtual Relation are in parentheses)

    Number of fields

    Account

    16

    Opportunity (important__v)

    10

    Contact (ceo__v)

    13

  • Numbers of SOQL queries issued and records retrieved

    • Total number of SOQL queries issued

      87

    • Total number of records retrieved

      803

  • CPU time

    14,492 milliseconds