Execution Order - SalesforceLabs/record-hunter GitHub Wiki

What is Execution Order?

Record Hunter components work in sequence, passing search results from one to another like a relay. The flow of a record search on the page created in the Quick Start follows these steps:

  1. RHG - Action Buttons: Triggers the search by sending a request to RHG - Search.
  2. RHG - Search: Searches for records based on the entered keyword and passes the results to RHG - Filter.
  3. RHG - Filter: Filters the results further based on specified conditions and sends them to RHG - List.
  4. RHG - List: Retrieves the necessary field values based on the filtered results and displays them on the screen.

Setting the Order Property

When using Record Hunter, it's essential to set the Order property for each component to ensure they run in the intended sequence. The Order property defines the execution flow between components that send or receive search results.

An exception is RHG - Action Buttons, which uses the Target Component Order property instead of the Order property. This property defines the Order value of the component where the search process begins, as RHG - Action Buttons only triggers the search but doesn't perform the search itself.

Common Patterns

The components execute in the order defined by the Order property. To ensure proper handoff, the Order values must be sequential. Here are some examples:

Example 1: Using RHG - Search and RHG - List

  1. RHG - Action Buttons: Target Order = 1
  2. RHG - Search: Order = 1
  3. RHG - List: Order = 2

Example 2: Using two RHG - Filter components (e.g., for grouping search conditions)

  1. RHG - Action Buttons: Target Order = 1
  2. RHG - Filter: Order = 1
  3. RHG - Filter: Order = 2
  4. RHG - List: Order = 3

Example 3: Placing two search processes on one screen

  1. RHG - Action Buttons: Target Order = 1
  2. RHG - Filter: Order = 1
  3. RHG - List: Order = 2
  4. RHG - Action Buttons: Target Order = 4
  5. RHG - Filter: Order = 4
  6. RHG - List: Order = 5

By controlling the Order property, Record Hunter allows for flexible and advanced search configurations.