In this scenario, we want to make sure that any Opportunity that is associated with a disabled User gets flagged so that it can be reassigned.
We want to show a notification when an Opportunity is opened and the Opportunity's parent Account is owned by a disabled User.
North52 Decision Suite
The North52 Decision Suite solution works like this:
- A formula is created that will trigger whenever a Opportunity record is opened
- The formula will check to see which User owns the parent Account of the Opportunity
- If the User is disable/inactive, the formula will set a form notification on the Opportunity to let users know it needs attention
- Navigate to Settings > N52 Formula
- Create a new formula, setting the following values in the Formula Guide:
- Source Entity set to Opportunity
- Set Formula Type to Clientside - Perform Action
- Set Event to Create & Update
- Select the Classic Editor
- Change the Name of the formula to Check if Parent Accounts Owner is Active
- Expand Source & Target
- In Source Property select OnLoad for the form that needs to show the notification
- Note if you see a message about duplicate form names, you will need to rename the forms until they are all unique. Go to Settings > Customizations > Customize the System
- On the Classic Editor, copy and paste the following formula:
iftrue(FindValue('systemuser','systemuserid',[opportunity.parentaccountid.ownerid.?],'isdisabled','?','true')= 1, SetFormNotification('Customer Account is inactive, please change to an Active account','WARNING')
- Click Save
To test the formula:
- Open up an Opportunity using the form you selected under Source Property above:
- Go to its parent Account by clicking the lookup field and from there, you can see the Owners lookup field like below:
- Disable this User and then go back and refresh the Opportunity form. You will see the form notification like below:
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.