Skip to main content

Notifications

Announcements

No record found.

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

addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

Posted on by 535

Hello,

I am trying to use addPreSearch() function on "ownerid" field of "Lead" entity in a Unified Interface app. But it is not working. I confirmed that Lead Entity, its all forms, Team entity, all forms and views of Team entity are added to the App. I am using OnPremise 9.0.17.8 version.  The code is below. Debugger in the AddOwnerLookupFilterTeamType function is not triggering. Same code works in a cloud envoirenment.

OwnerLookupFilterOperation: function (context) {
debugger;

var formContext = context.getFormContext();

formContext.getControl("ownerid").setEntityTypes(["team"]);
formContext.getControl("ownerid").addPreSearch(AddOwnerLookupFilterTeamType);

},

AddOwnerLookupFilterTeamType: function () {
debugger; // this debugger is not triggering

var formContext = arguments[0]._formContext;
var teamTypeFilter = "";
formContext.getControl("ownerid").addCustomFilter(teamTypeFilter);
},

  • oriel Profile Picture
    oriel 65 on at
    RE: addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

    Thanks for the answer what a creative solution,

    in your case if you need only owners from systemuser type,  you can use a new systemuser lookup field and add filter on him and populate the ownerid field when updating the new field

  • furkank Profile Picture
    furkank 535 on at
    RE: addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

    @Hi it seems you cant filter multiple entity field lookups. In my case ownerid was both systemuser and team type i couldnt apply filter. I am assuming thats why you cant filter "to" field too. What i did is, Instead filtering ownerid i used Xrm.Utility.LookupObjects and showed a lookup dialog, i showed systemuser view, then i set the ownerfield on the callback.

  • oriel Profile Picture
    oriel 65 on at
    RE: addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

    Have you been able to find a solution to this? , we are encountering the same thing for field "to" in email entity

  • furkank Profile Picture
    furkank 535 on at
    RE: addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

    Thanks for your reply.

    Unfortunately i can't go cloud version because the cloud is another projects envoirenment, i just checked if is the code or the envoirenment is generating the error. I thought maybe i'm missing a point , i want to be sure if everything i do is correct , if so then i have to go MS support.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: addPreSearch() filter on ownerid field doesn't working in v9 Unified Client app

    Hello,

    Seems you found another one bug in UCI interface implementation of On-Premice deployment.

    You have 2 options:

    1. You can get in touch with Microsoft and open a ticket to get this issue resolved.

    2. You can go cloud version that doesn't have this issue.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans