In my model-driven app, I'm using a PCF control "N to N Multiselect" on a form and I want to filter the options available in it based on the selected value of another field (a lookup) on the form. The PCF control settings has an option to use a FetchXML Webresource for filtering the data. How to I create FetchXML that looks at the selected value of the other field?
Hi @DianaBirkelbach ,
I haven't gotten this to work yet. It sounds like you can't compare columns across entities. I'm thinking I'll need a javascript solution.
Hi @tschopp ,
I had a look on the blog about the control: https://www.itaintboring.com/dynamics-crm/is-it-a-multiselect-optionset-nope-its-an-nn-lookup/ . In the comments below it, it seems that somebody solved the problem with a PlugIn registered on RetrieveMultiple.
I'm thinking if it would be possible to solve your problem by defining the FetchXml with an extra "linked-entity" to the parent entity. Using the ColumnComparison in FetchXML (https://markcarrington.dev/2020/07/15/column-comparisons-in-fetchxml/?utm_campaign=Power%20Platform%20Developers%20Weekly&utm_medium=email&utm_source=Revue%20newsletter) you should be able to make a condition comparing with the parent entity attributes. That would filter the records as you need, right?
Not sure if it works, since I have't used the control.
Hope it helps!
Kind regards,
Diana
You have an inherit problem in that the PCF is probably bound statically to the Fetchxml, but you want it to be changed dynamically.
You could take a field value as an input by bounding the PCF to a field and do the filtering that way. That means you have to copy the PCF and modify the code to your needs
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72