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.
N52 Formula Manager Solution
The Formula Manager 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)
N52 Formula Manager 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?
You can Connect to 1000s of Web Services as part of your Decision Logic
When your advanced business rules and complex logic requries that you integrate with other systems North52's Web Fusion functionality can help. It enables two-way data communication between your Dynamics 365/CRM system and another service or application.