Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Javascript addpresearch not working in UCI

Posted on by Microsoft Employee

HI Team

Javascript addpresearch not working in UCI, throwing error as "

UciError: Required parameter is null or undefined: handler"

Could you please help on this?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Javascript addpresearch not working in UCI

    Hey Manasa,

    I have applied a addPreSearch script just recently in UCI and it works fine.

    I've noticed that the most important thing developing anything with JS for the UCI, is always to use the latest supported ways, which means you need to use the executionContext (and formContext) instead of the good old Xrm.

    On the other hand, if you know the procedure on how to apply a addPreSearch you will know, that you need to add the presearch via calling another function, which will add a fetchXML query via addCustomFilter. Unfortunately you cannot pass the formContext further when you call the second function.

    In order to do all this, I have come up with a little workaround using the execution context. I think the code says more than a thousand words. You simply will need to call the "LookupFilter" function onload and pass the executionContext as first parameter (tick the necessary box when adding the function on the form).

    pastedimage1573664560077v1.png

    Cool thing is, it also works inside the BPF. To accomplish that, simply add "header_process_" as a prefix for the fieldname if this field is in the BPF:
    pastedimage1573664641497v2.png

    I hope that my approach helps you or any other colleague from the Dynamics world experiencing issues with this requirement.

  • Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Javascript addpresearch not working in UCI

    Hello Manasa,

    It will be more investigable if you can share the code. However, there are some threads that might be helpful for you. Please see below link:

    community.dynamics.com/.../addpresearch-and-not-working-in-dynamics-crm-365-v9

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Javascript addpresearch not working in UCI

    Hello,

    Can you please provide code you use?

  • RE: Javascript addpresearch not working in UCI

    Not working for me as well. Is there any bug around this?

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans