Hello Dynamics people,
I hope you are doing well.
I have this use case:
The user will examine an entity called "program" in this entity we defined 2 views:
- The first view is the default view (this view will not be dynamic, in other words all the users will have the same filtering condition)
- The second view will be a dynamic view, in other words the filtering condition will depend on the user triggering the plugging on RetrieveMultiple (wthe filtering depend exactly on the division that the user belongs to
- Note: I want to know the active View because I won't be making any changes to the filtering condition if the active view is the default view
I have two issues here or rather I am looking for the best solution to accomplish all of this:
1 - What is the best way to define the filtering conditions deponding on a division
2 - How to get the active view in the plugging
My solution:
step 1 - I will create an entity wich will contains all the filtering conditions for a specific division
step 2 - For the pluggin case: I came to know that there is no way to know the current active view but we have an access to the Query in InputParameters which contains the FetchXML for the active view, so my idea is to put an attribute to the created entity (step 1) then add that attribute to result of the default view then if that attribute exist in the Query the I will stop the execution of the plugging if note then I will apply the new filtering conditions.
I don't if this is the best solution or maybe there is better solutions, I hope that the use case is clear.
I will be waiting for your suggestions.
Thank you.