Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

fillLookupFromSearch not working correctly if user uses tab to navigate

Posted on by 2

Hey Experts,

I have build a marketing form with a lookup field. First obstacle I have is that for filtering the elements to show you can only use certain default views. Can somebody confirm this?

While finding a way around this I found the awesome functionality to inject JavaScript into the form to filter the lookup on render:

MsCrmMkt.MsCrmFormLoader.on("afterFormLoad", function() {
MsCrmMkt.MsCrmFormLoader.fillLookupFromSearch("2c1b6325-caf3-ec11-bb3d-000d3abf3315", "- Power Platform Webinar")
.then(function (r) {
console.log("Success performing search");
}).catch(function (e) {
console.error("Error performing search");
});
});

This is kind of working. When I move the cursor from one field to another field by selecting it with a mouse click, the entries are getting filtered as needed. However when using the tab-button to move into the field the field is loading all entries.

Somebody experienced this too and knows how to fix it? 

pastedimage1656084297240v1.png

Thx for your help!

Regards,
Alan

  • Suggested answer
    Petr Jantac Profile Picture
    Petr Jantac on at
    RE: fillLookupFromSearch not working correctly if user uses tab to navigate

    Hi Alan,

    It should be possible to select custom queries to filter lookup fields. Please file a support ticket to ensure we can assist further. Our support engineers would then be able to check your environment. admin.powerplatform.microsoft.com/  

    Thanks

    Petr

  • Alan Rachid Profile Picture
    Alan Rachid 2 on at
    RE: fillLookupFromSearch not working correctly if user uses tab to navigate

    Hey Petr,

    thank for your reply. I was trying the approach you are mentioning but it looks like that you can only choose default saved queries and no personal queries. Can you confirm this?

    Cheers,

    alan

  • Petr Jantac Profile Picture
    Petr Jantac on at
    RE: fillLookupFromSearch not working correctly if user uses tab to navigate

    Hi Alan,

    You can select a view when the lookup field is set up. There is an option to use saved (already existing) query in the lookup field. That's the best way to see the intended values in the lookup field (better than using JS for filtering on the fly).

    Thank you.

    Petr

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans