To enhance the user experience when creating an Opportunity we want to only show the Accounts that are either owned by the current user or a team they belong to when the user clicks the search button for the look up field.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- A formula of type 'ClientSide - Perform Action' is created and set to run on the Onload event of the Opportunity form
- When the form is loaded the Account lookup field is prefiltered according to the filter parameter specified by a fetch-xml fragment (we only used the filter part of a fetch-xml query)
North52 Decision Suite Steps
The following set of steps outline how to create this Formula:
- Create a new formula of type 'Client - Perform Action'
- Set the Event picklist to 'Create & Update'
- Set the Source Entity to 'Opportunity'
- Set the Source Property to 'OnLoad' for each form you wish the filter to apply (CTRL-Click to select multiple)
- Copy and paste the formula below into the formula
- Click Save
- Update the formulashortcode parameter in your formula to match the Short Code of your formula
- Click Save
- From the N52 Commands menu select 'Publish formula'
/* filter the Account lookup field so that only Accounts owned by current user or a team they belong are shown */ AddPreFilterLookup('parentaccountid', 'd0H', '<filter type="and"><condition attribute="ownerid" operator="eq-useroruserteams"/></filter>', 'account')
This formula can be easily modified with your own filter criteria and/or to target a different lookup field
Did you know?
Quality Dynamics 365 Projects are Delivered Faster with TestShield
Deliver fully tested Dynamics processes earlier and at less cost. Product owners, testers and developers collaborate easily, delivering fully tested systems in short sprints.
- Accurately capture test data in visually in Excel like sheets
- Create perfect automated tests with data and execute on a schedule or within your Azure DevOps pipelines
- Quickly update easy-to-use spreadsheets to maintain tests