Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Customize the ItemId lookup

(0) ShareShare
ReportReport
Posted on by

Hi All,

I created a new lookup form.

My new lookup form should replace the item lookup using coc.

I tried coc in the base class of the item lookup.

I just take the coc and put info on it.

But its not working.

The break point also not hit in the coc and also in the standard class InventItemIdLookupSimple.

[ExtensionOf(classStr(InventItemIdLookupSimple))]
final class InventItemIdLookupSimple_Extension

public static void lookupItem(FormStringControl _ctrl, boolean _showOnlyWHSEnabled )
{

info("InventItemIdLookupSimple 1");

next lookupItem(_ctrl,_showOnlyWHSEnabled);
info("InventItemIdLookupSimple 2");
}

is this the base class for itemlookup? or something else.

Could you tell me where i have to take coc to change the itemlookup to my new lookup form.

Thanks

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Customize the ItemId lookup

    Hi john,

    this would require that you could replace the logic of the existing lookup class (InventItemIdLookupSimple). You can't replace standard system logic with extensions - unless the system specifically grants this in some scenario (for example [Replaceable] attribute).

    So it's possible that your requirement can't be solved without adjusting every single lookup field separately.

  • Community Member Profile Picture
    on at
    RE: Customize the ItemId lookup

    Hi Nikolaos,

    Thanks for the reply,

    I did it by using event handler onlookup method for a particular itemid control in a particular form.Its working fine.

    But i need to make my lookup form as a default form wherever the item id lookup control is.

    Could you tell me the class which i need to use the eventhandler to make my lookup form as default.

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Customize the ItemId lookup

    You can check the link below for the coc version. It's not exactly true, but the logic is correct. With Control's registerOverrideMethod method, he override the original lookup and called his own lookup. I haven't tried it but it seems correct.

    www.axug.com/.../viewthread

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Customize the ItemId lookup

    I don't think there is a class behind the ItemId lookup (at least I couldn't remember).

    I am sharing the version that Ievgen made with the event handler.

    ievgensaxblog.wordpress.com/.../

    Edit: I couldn't remember when you said class. I think you are talking about form

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Customize the ItemId lookup

    Hi john,

    I think you might have several problems here.

    - Your debugging setup might not be correct - please search for existing discussions or post a new question if you need help with it

    - Your code prints two lines to infolog, but you wrote that you want to replace the lookup logic. Therefore I assume you didn't share your actual code with us. But your current code should print some infolog when it's run - so if it doesn't do it, then you're not extending the correct place.

    - I don't think that you can replace the existing lookup with Chain of Command. But you can do it with an event handler, and FormControlCancelableSuperEventArgs

    community.dynamics.com/.../how-to-override-form-control-lookup-using-extensions-d365fo

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,424 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,043 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans