Repeatable SOQL Filters

From 3B Knowledge
Revision as of 08:37, 6 October 2022 by Admin (talk | contribs) (Created page with "== Intro == Repeatable containers are containers that repeat for each record in a record set. Most often than not, this will be a child record of the contextual object == Usage == When a repeatable container is added on a template, you can set a custom SOQL filter to limit the number or type of records for the repeatable record set. == Validation == The application will validate the inputted SOQL Filter by performing an SOQL query on the contextual object with a limit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Intro

Repeatable containers are containers that repeat for each record in a record set. Most often than not, this will be a child record of the contextual object

Usage

When a repeatable container is added on a template, you can set a custom SOQL filter to limit the number or type of records for the repeatable record set.

Validation

The application will validate the inputted SOQL Filter by performing an SOQL query on the contextual object with a limit of 0 records. Any errors that are identified in the SOQL Query will be returned as an error message against the SOQL filter input.

Note that if you are adding URL Params as filters in the SOQL, the app will validate the SOQL Filter entered with a placeholder value of an empty string.

Tips & Tricks

  • You can request all records to be returned by using the filter "Id != null"

URL Params

TODO: Verify with dev team

You can pass filters to repeatable containers from the URL of the document. Just make sure to pass the parameter key and value in the URL of the document, and the application will do the rest for you.

As an example if your document URL looks like this: .../b3d__Document?templateId=123&recordId=0987&contactFirstName="James" then you can add SOQL filters such as "FirstName = {params.contactFirstName}" where the contactFirstName URL param will get automatically merged with the value in the URL. In this example, the SOQL filter will compile to "FirstName = 'James'" in runtime.

Considerations

  • We store custom SOQL filters in the object "SOQL Filter" and we retrieve records by the unique identifier. If an SOQL Filter record is deleted, it may break the template(s) that implement it.