Hello Community,
Does anyone know if related records filtering on custom lookup field is supported on PowerApps Portal?
The situation I have is that I have created a custom PowerApps portal, connected to my Dynamics 365 instance. In Dynamics 365, I have a Lead entity form where I have created a custom lookup field, let's called it Lookup A. I have set related records filtering on Lookup A, based on another field Lookup B. It's all working successfully as expected on the Lead form in Dynamics.
However, the problem occurs when I use the same Lead form on the portal page for user to create the lead record through the portal. On the portal page, when clicking on Lookup A (with Lookup B populated), the related record filtering doesn't work. Instead, there is an error message displayed after clicking on Lookup A, showing "We're sorry, but something went wrong. Please try again, and if this persists, contact the website administrator". And when clicking the filter icon at the top of the popup lookup records window, the error message goes away and display all records in Lookup A, instead of the expected filtered records for selection. Please see screen shots below.
I have contacted Microsoft support on this, but after almost 3 weeks Microsoft still cannot figure this out. This is really puzzling and I can't find any solutions for it. I am not a developer (I don't write codes), and I am really hoping there is a way via configurations to fix this problem without needing to apply any custom codes.
Any pointers would be appreciated.
Thank you!
Eric
Hi @Anonymous ,
This line:
$("#dwc_primarycategorization").change();
is triggering a change event. If you don't want to trigger the change event on form load you can just omit it.
this code from you blog
$("#dwc_primarycategorization").change(onPrimaryChange); $("#dwc_primarycategorization").change();
is being triggered when the entity form is loaded not when the lookup field is changed.
Hi @Anonymous ,
In my article I am mentioning two post from Colin Vermander (first and second) where he goes into more details about the method of retrieving data. In short: you need to create a web page where underlying web template will have a required fetchxml query that can receive parameters and will act as your API. So just create a web page with that web template and call it from javascript.
Hi @OOlashyn ,
Thanks again for your information on this. I would like to circle back on this topic as I have a follow-up question after going through the blog you have shared. In the blog, it says we will need to create a web template with correct fetchxml query that will receive as a parameter id of the main dropdown and will return us a list of records that we will add to our select. It then provides a sample of the code to be used in the web template.
My question is: where and how should I apply this web template? Do I simply add the new web template?
Thanks!
Hi @Anonymous ,
I agree with @OOlashyn 's thought almost. Currently, the Related record filtering works only on edit forms.
If you want to filter a LookUp field based on another LookUp field in your PowerApps Portal Entity form, please check the following blog:
https://www.dancingwithcrm.com/custom-lookup-filtering-powerapps-portal/
More details about using FetchXML Query to retrieve Entity records from CDS Entity, please refer to the following article:
Best regards,
Thanks for your reply and sharing the information! I am very surprised that this is a gap on the portal functionality. I would have expected this to behave the same as the form in Dynamics 365...
But thank you for sharing your blog post! I will look into this accordingly.
Hi @Anonymous ,
Unfortunately, related lookup filtering on the portal works only on the edit forms. I found a custom workaround - using liquid page template and render lookups as a select dropdown and replacing values with javascript code. You can find a detailed description of how you can do it in my blog post.
Hope this will help.
WarrenBelz
146,786
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional