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.

  • Suggested answer
    David Pezzoli Profile Picture
    7 on at
    RE: Intercept/replace the New button click of lookup field?

    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-

  • Suggested answer
    prt33k Profile Picture
    6,907 on at
    RE: Intercept/replace the New button click of lookup field?

    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

  • Marina Karapetyan Profile Picture
    76 on at
    RE: Intercept/replace the New button click of lookup field?

    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
    RE: Intercept/replace the New button click of lookup field?

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,138 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans