Views:

Scenario Overview

In this scenario we require a max character limit of 25 characters for the Account fields Street 1, Street 2 and Street 3. Any characters over this limit will be truncated. We want this rule to be applied to data BEFORE it is committed to the database and no matter where it comes from - e.g. from an import, SDK call, standard input form. The SetEntityTargetRecord function allow us to do this.

N52 Formula Manager Solution

The Formula Manager solution works like this:

  • A formula of type SavePerform Action is created that triggers on creation or updating of Account fields: Address 1: Street 1 , Address 1: Street 2 and  Address 1: Street 3
  • The formula ignores any characters after the 25th character
  • The formula does this at the Pre-Operation stage so that the fields are validated before they are saved into the database 

N52 Formula Manager Steps

Setup

  • Create a new formula of type 'Save- Perform Action'
  • Set the Event to 'Create and Update'
  • Set the Source Entity to 'Account'
  • For Source Property Ctrl-click  'Address 1: Street 1, Address 1: Street 2 and Address 1: Street 3'
  • Scroll down to Deployment Settings and for the Pipeline Stage select 'Pre-Operation'
  • In the Formula Editor, paste in the Formula provided below
  • Click Save
  • The formula is now ready for testing 

Formula

SetEntityTargetRecord(
    SetAttribute('address1_line1', left([account.address1_line1], 25) ),
    SetAttribute('address1_line2', left([account.address1_line2], 25) ),
    SetAttribute('address1_line3', left([account.address1_line3], 25) )

    )