Views:

Scenario Overview

In this scenario our business requirement is to validate that the Estimated Close Date on the Opportunity record cannot be set to a date before the create date.

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • We create a formula that fires on the create & update events of the Opportunity entity
  • The formula needs to execute on the client-side (i.e. when user tabs out of date field)
  • The formula needs to execute on the server-side (i.e. if importing a CSV file, or via a 3rd party integration, etc.)
  • We set the Mode to Client Side & Server Side to meet the above requirements.
  • When the formula executes it makes the date comparison & if it fails shows an error message

    

 

North52 Decision Suite Steps

  • Create a new formula of type 'Validation'
  • Set the Event field to just 'Create & Update'
  • Set the Mode field to 'Client Side & Server Side'
  • Set the Source Entity to 'Opportunity'
  • Set the Source Entity Property 'Est. Close Date'
  • Click 'N52 Commands -> Toggle Advanced View' and change the pick-list field 'Stage' to have the value 'Post-Operation'
  • Copy & paste the formula below into the formula description field & click save
  • You are ready to test

Formula

if( [opportunity.createdon] > [opportunity.estimatedclosedate],
  'You cannot have an estimated close date before the create date', 'NoOp')

Did you know?

TestShield automated tests for Dynamics 365 are easily exported/imported

TestShield uses standard Dynamics 365 solutions to package up your configured tests for easy transport and deployment to other Dynamics 365 instances.

This enables use in automated Azure DevOps pipelines where you can automate the build of a Dynamics instance and apply the TestShield solution to execute your tests. 

It also allows you to put your automated tests into source control alongside other customizations.

Learn more about TestShield