web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Intercept/replace the New button click of lookup field?

(0) ShareShare
ReportReport
Posted on by 76

Hello

How can I intercept/replace the New button click of lookup field?

Thanks.

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Marina,

    You need to remove the 'Create' privilege from the users security role for lookup entity to hide the 'New' button.

    That is the only supported way.

    Thanks,

    Prateek

  • Marina Karapetyan Profile Picture
    76 on at

    Hello Prateek,

    Thank you for your answer, but I want to write my own logic when click New button of lookup field.

    So, I am going to write JS and customise button or command. Is it possible ?

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Marina,

    D365 doesn't provide a way to customize the lookup control. So you won't be able to write JS on the + button in a supported way.

    However, You can always build a custom PCF Control and add your functionality there.

    Thanks,

    Prateek

  • Suggested answer
    David Pezzoli Profile Picture
    14 on at

    Hi Marina Karapetyan,

    as an alternative to PCFs, you can:

    1. add a Recommendation Action button on lookup field (column) using the JS command:  formContext.getControl(lookupfield).addNotification(notification) https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/addnotification
    2. inside command "notification" Object you can call an action on-demand using "actionCollection.actions": for example open a dialog form via navigateTo or call another action....Lookup-wit-recommendation.png
    3. hide the "+ new item record" lookup button (in order to avoid unwanted behavior lookup): 

    https://blog.magnetismsolutions.com/blog/jaredjohnson/2020/04/03/--toggling-the-new-button-in-inline-lookups-in-dynamics-365-

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans