Saturday, September 1, 2018

Dependent OptionSet(Picklist) consideration in Dynamic 365 CRM


Recently I was strike again with a very old and familiar requirement that we all might have come across in Microsoft Dynamic CRM –
How to create a dependent Pick-list/Option set list where the options of Second Pick-list are dependent on the Value of the First one.

We can achieve multilayer of dependency for so-called Pick-list/Option Set in Microsoft Dynamic CRM with the help of

           JavaScript coding, Form and Field level customization

Here is MSDN article which help to Create dependent OptionSets (picklists)


You can find a very relevant tool (Dependent OptionSet Generator) to help in development of dependent picklist faster https://crmoptionsets.azurewebsites.net/




!!! Question is there a better way to achieve such requirement.

Can we not achieve this by using a Filtered lookup – no coding involve – will you not be happy with just customization and a much faster development!

Let us try to evaluate some benefits of using Filtered Lookup.
  • Form's Related Records Filtering functionality to control the available selection of list items
  • Easily add and deactivate list items, without changing any code.
  • Almost no coding and debugging involved and a much faster development.
  • Large dataset can be easily imported into lookup entities.


Disadvantage of Filtered Lookups
  • Require creation of entities for possibly just one value.
  • Report performance and other such retrieval performance problem as it may cost you with joins and linked entity.
  • What if someone accidentally delete any record, it will be gone from all our records.
  • All security role then must have full READ permission for such entities, otherwise user might face problem.
  • Waste of resources-creating entities will have tables in SQL and other unnecessary empty fields would been created.
  • Once the record is selected in Lookup and if user need to change then, it require more clicks.




Benefits of Optionset
  • They are faster in form rendering, reports and any other retrieval operation.
  • Neat and Clean
  • Complete control from System Admin and System Customizer

Disadvantage of Optionset
  • Require developer to code
  • A little complex to play with Json configuration to add and remove optionset values.



One more CHALLENGE to our Implementation

Can we consider some more factor here ?
  • Importing Data via Import Job  
  • Bulk edit using Excel Online
  • Integration with other System

As our implementation from either Dependent Picklist or Filtered Lookup are JavaScript (Client-side), they will ignore all validation that might be our Prime Objective.

So in this scenario, we need to implement Pre-Validation plugins, which will restrict user to not to select wrong options.  

I hope there will be more consideration to come with such a small requirement J.

Thanks,
Vipin Jaiswal

No comments: