Views:

Scenario Overview

In this scenario you need to format the main telephone number field of the Account entity. The format needs to look like this "207.555.3652". This makes the phone number formatting consistent across all accounts. It must also be able to strip out all non digit characters so if a user enters fields such as these they are ignored  e.g. '(', ')', '-'.

Note 1: This formatting rule must apply in the following scenarios,

-User enters data from Outlook,
-User enters data from the browser Web Client,
-User enters data from Mobile Client,
-Records are imported (e.g. via a CSV or Excel file)
-Data comes from an external data source such as a Portal.
-Data comes from an external data source such as an Integration Server

N52 Formula Manager Solution

The Formula Manager solution works like this,

  • We create a formula that executes on the server-side when ever the Main Phone number field on the Account entity changes.
  • Next we use a Regular Expression to remove all the non-digit characters
  • We then use another Regular Expression to apply our formatting
  • Then we take the overall result of the formula & place it into the Main Phone number field

N52 Formula Manager Steps

  • Create a new formula of type 'Save to Current Record'
  • Set the Source Entity to 'Account'
  • Set the Source Property to 'Main Phone'
  • Set the Target Property to 'Main Phone'
  • Copy & paste the formula below into the formula description field & click save
  • You are ready to test

Formula

RegexReplace(RegexReplace([account.telephone1], «\D», ''), «(\d{3})(\d{3})(\d{4})»,«$1.$2.$3»)

Did you know?

North52 has over 500 functions to help you implement advanced business rules and complex decision logic

One of the biggest costs on most Microsoft Dynamics 365/CRM project is custom coding. This is where consultants or developers are invloved in writing 100’s if not thousand’s of lines of code in Javascript and/or C#.

The Formula Manager, part of the North52 Decision Suite is a business rules engine that aims to eliminate this custom coding by using simple formulas instead. It is significantly faster (up to 10 times) than writing custom code and you get the added bonus of lower cost updates if a business rule changes in the future (it is much faster and thus cheaper to change it using a Formula rather than custom code).

There are over 500 functions available in the North52 Decision Suite business rules engine!

Learn more about North52 Business Process Activities