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 

N52 Formula Manager Solution

The Formula Manager 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. 

N52 Formula Manager 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?

TestShield Makes Test Automation a First Class Citizen in Dynamics 365

Test automation principles leads to improved communication, reliability and teamwork as you enhance the ever changing business processes. The team members need to roll out change requests on the existing system and build new applications making automated testing very important. 

Top 3 Benefits of Dynamics 365 Automated Testing:
  • Validated Business Processes: Dynamics 365 Automated Testing provides a robust approach to validate the business rules and process requirements of Dynamics 365 solutions
  • Better Engagement: Dynamics 365 Automated Testing ensures that end users get top-class user experience
  • Faster Delivery Time: Dynamics 365 Automated Testing assures fast delivery time by leveraging automation

The growing number of Dynamics applications that are being developed continuously presents a major challenge for Dynamics 365 testing. With such fast development, organizations need to ensure that these applications are thoroughly and constantly tested before being deployed.

Learn how TestShield helps automate testing in your Dynamics 365 projects