Views:

Scenario Overview

In this scenario we are updating our Contacts address information. We have a custom entity called Address Change that will be filled with this information via incoming sources (e.g. a portal form ). We will use this information to update our contact address or create a new contact if needed. 

For this example you will need to create the custom entity Address Change along with the custom fields: new_firstname,  new_lastname, new_address1street1,  new_address1street2 ,  new_address1street2 ,  new_address1zippostalcode ,  new_address1city ,  new_address1countryregion , new_address1stateprovince 

North52 Decision Suite Solution

The North52 Decision Suite solution works like this:

  • A formula of type 'Save - Perform Action' is created so that it is triggered when an Address Change record is created.
  • The formula executes an 'UpdateCreateRecord' function which checks the first name and the last name fields in the Address Change entity against the Contact fullname. 
  • If there is a match, update the Contact address fields with their corresponding Address Change fields. 
  • If there isn't a match, a Contact will be created with the Address Change fields. 

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula of type Save Perform Action
  • Set the Event picklist to 'Create'
  • Set the Mode to 'Server Side'
  • Set the Source Entity to 'Address Change'
  • Set the Source Property to 'All Properties
  • Copy & paste the formula below into the formula editor Canvas 
  • Click Save

Formula

UpdateCreateRecord('contact',
             FindValue('contact','fullname', [new_addresschange.new_firstname] + ' ' + 
                       [new_addresschange.new_lastname] ,'contactid','?','true'),
  
             SetAttribute('address1_city', [new_addresschange.new_address1city]),
             SetAttribute('address1_country',[new_addresschange.new_address1countryregion]),
             SetAttribute('address1_stateorprovince', [new_addresschange.new_address1stateprovince]),
             SetAttribute('address1_line1', [new_addresschange.new_address1street1]),
             SetAttribute('address1_line2', [new_addresschange.new_address1street2]),
             SetAttribute('address1_line3', [new_addresschange.new_address1street2]),
             SetAttribute('address1_postalcode', [new_addresschange.new_address1zippostalcode]),
             SetAttribute('firstname', [new_addresschange.new_firstname]),
             SetAttribute('lastname',[new_addresschange.new_lastname])

  )

 

Wizard - FindValue

Please see below the wizard you can use to create the FindValue() function call used in this formula. 

Note to find the value for Equals Value, you will need to copy and paste the below. 

[new_addresschange.new_firstname] + ' ' + [new_addresschange.new_lastname] 
  
where the two fields are custom 

 

Did you know?

North52 TestShield ensures Quality at Speed

TestShield's automated tests run on the Dynamics 365 platform rather than in the browser allowing extreme speed.

For example, we can run 1100 tests with over 15,000 Asserts to verify a new release of the North52 Decision Suite, in less than 4 minutes!

It means that we can deliver quality releases at unprecedented speed. Before TestShield, testing a new release was very manual and time consuming.

Learn how TestShield helps speed up your releases