Email Scheduled Event Templates without "For Rows ..."

When you define a scheduled workflow Email rule, you can specify a template file to use for the email body or attachment.

Please read this article before reading further; it describes how simple templates work.

 

Scheduled versus Event Triggered Workflow Rules without "For Rows ..."

Scheduled workflow templates that do not specify the "For rows in this table" option are similar to Event Triggered workflow templates, but they differ in some respects.

 

Scheduled Rules Require a Start Expression

An event triggered workflow rule is always invoked when an individual record is added, updated, or deleted. That record is passed to the event triggered workflow rule, and the template is evaluated with respect to that added, updated, or deleted record. The variables and expressions contained in the template refer to the fields of the added, updated, or deleted record.

By contrast, a scheduled workflow rule is not invoked when an individual record is added, updated, or deleted. Instead, it is simply invoked on the schedule you specify. No record is passed to the scheduled workflow rule. You must specify a Start Expression that yields the list of records you wish the scheduled workflow rule to display. To be more specific, the Start Expression must yield the list of key values of the table rows to be displayed. The error message "Start expression 'xxx' refers to a table with missing meta data" may indicate that your Start Expression is not retrieving the table's key values.

You cannot create a scheduled rule by simply copying an existing event triggered workflow rule and marking it as scheduled. You must, at a minimum, add a Start Expression that yields a list of key values to the outermost template.

 

Scheduled Rules Seldom Specify a Condition

Scheduled workflow rules and Event Triggered workflow rules differ in another important way.

Event Triggered workflow rules often specify an "... And This Is True ..." Condition. In an Event Triggered workflow rule, the Condition is used to prevent invocation of the workflow action for some input records. For example, you might only invoke the workflow action when a field in the updated record has a particular value. 

It seldom makes sense to specify a Condition for a Scheduled workflow rule that does not specify the "For rows in this table" option. No record is passed to such scheduled workflow rules, so there no record for the "Condition" to check. 

Instead of using a Condition in such a Scheduled workflow rule, your Start expression must yield exactly the right list of records. The easiest way to do this is to create a slice over the table your Scheduled workflow acts on. This allows you to verify that your slice returns exactly the right list of records. In your workflow rule, specify the initial Start expression:

"<<Start:FILTER(yourSliceName, true)>> 

 

Scheduled Templates

The example scheduled templates that follow are all based on the Order Capture sample application. This sample includes both an email body template and an attachment template. The variables in the example templates refer to the fields in the Order Capture sample application.

 

Scheduled Template in List Format

This template is used to display Orders in list format.

It contains templates that display:

  1. The parent Customers record for each Orders record displayed in list format.
  2. The child Orders record displayed in list format.
  3. The list of child Order Details records for the Orders record displayed in list format.

 

 This template produces the following output:

 

 

 

Scheduled Template in Table Format

This template is used to display Orders in table format.

It contains templates that display:

  1. The parent Customers record for each Orders record displayed in list format.
  2. The child Orders record displayed in list format.
  3. The list of child Order Details records for the Orders record displayed in table format.

 

This template produces the following output:

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.