Scenario Overview

Note: This functionality will be publicly available in the next release expected in early September 

This scenario will demonstrate how to change the options available in a pick list depending on who the user is.

The business requirement here is that the Category pick-list on the Account form will display different pick-list values depending on what security roles have been assigned to the logged on user.

Matrix of Security Roles to Option Set Values

  • Everyone  Standard Customer
  • Salesperson Standard Customer, Internal Customer, Local Customer, International Customer
  • Sales Manager - Sames as Salesperson and Preferred Customer
  • Marketing Manager - Standard Customer, Advertising Client, Advertising Partner
  • System Administrator All Options

OptionSet Values:

  • Internal Customer - 100000001
  • Local Customer - 100000002
  • Standard Customer - 2
  • International Customer - 100000003
  • Preferred customer - 1
  • Advertising Client - 100000004
  • Advertising Partner - 100000005

OptionSet view for System Administrator

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • A Formula of type 'ClientSide - Perform Action' is created on the Account entity
  • The triggering event is the 'Create & Update'
  • The Source Property is set to 'OnLoad'
  • The Formula first sets which picklist options should be be visible for each user
  • The AvailableOptions starts with 2 since every user should be able to choose Standard Customer 
  • Next each Security Role is checked for and if found the list of AvailableOptions is increased.
  • Finally the formula removes the trailing comma from the list and sets the picklist values on the Account  

*Note: A comma is added at the end of each option set list so they can be added together correctly, then the final trailing comma is removed by the Trim() function

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a new formula of type 'ClientSide - Perform Action'
  • Set the Source Entity to 'Account'
  • Set the Event to 'Create & Update'
  • Copy and paste the formula below into the formula
  • Click Save
  • Click N52 Commands and then Publish  
  • Time to test

OptionSet View for a Salesperson


    SetVAr('VisibleOptionsForSystemAdmin', '1,2,100000001,100000002,100000003,100000004,100000005,'),
    SetVar('VisibleOptionsForSalesPerson', '100000001,100000002,100000003,'),
    SetVar('VisibleOptionsForSalesManager', '100000003,100000004,100000005,100000006,'),
    SetVar('VisibleOptionsForMarketingManager', '1,2,'),
    SetVar('AvailableOptions', '2,'),
    IfTrue(IsUserInSecurityRoles(WhoAmI(), 'System Administrator'), 
    ifTrue(IsUserInSecurityRoles(WhoAmI(), 'Salesperson'), 
    iftrue(IsUserInSecurityRoles(WhoAmI(), 'Sales Manager'),
    iftrue(IsUserInSecurityRoles(WhoAmI(), 'Marketing Manager'), 
    SetVar('AvailableOptions', Trim(GetVar('AvailableOptions'), ',')),
    SetPickListValues('accountcategorycode', true, GetVar('AvailableOptions'))

Did you know?

North52 helps Government (federal and state) departments with complex rules in their Dynamics 365 systems

Public sector organizations frequently deal with large user bases and complex rules and routings. The North52 Decision Suite helps government orgnizations with Dynamics 365 manage processes like:

  • Case Management - task checklists, routing, prioritization and approval
  • Eligibility checks for applications/enrollment
  • Licensing administration

Learn more about the North52 Decision Suite