Views:

Scenario Overview

In this scenario we were asked to demonstrate how to carry out different actions depending on which field has changed on an Account record.

To do this we will use the PriorValue() function and the Case() Statement.

In this example we will update the description box of the account recording changes to the Streets in Address 1.       

Note that to use the PriorValue function, the formula must be executed as Pre-Operation

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • A formula of type 'Save - To Current Record' is created on the Account entity
  • The Source Property is set to 'Address 1: Street 1, Address 1: Street 2, Address 1: Street 3'
  • The Target Property is set to 'Description'
  • Scroll down to Deployment Settings , expand it and set Pipeline Stage to 'Pre-Operation (Synchronous)' 

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula of type 'Save - To Current Record'
  • Set the Source Entity to 'Account'
  • Set the Mode to 'Server Side'
  • Copy and paste the formula below into the formula
  • Click save and test

Formula

Case( true, 

  When(PriorValue('[account.address1_line1]') !=  [account.address1_line1]), 
  Then ('The field address1_line1 has been modified'),

  When(PriorValue('[account.address1_line2]') !=  [account.address1_line2]), 
  Then ('The field address1_line2 has been modified'),
   
  When(PriorValue('[account.address1_line3]') !=  [account.address1_line3]), 
  Then ('The field address1_line3 has been modified'),

  Default('NoOp')

)

 

Did you know?

Decision Tables Simplify Complex Logic

Decsion Tables allow you manage complex business logic without code.  Key features include:

  • Simple visualization in a compact table format
  • Promotes grouping of rules in a single table
  • Business logic can be controlled by domain experts

A Decision Table represents multiple related business rules by using conditions, actions and data values in a spreadsheet-style table. The Decision Table uses columns for the conditions and actions of the rules and rows to represent the associated data values.

Learn more about Decision Tables