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 :
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

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    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
    ergun sahin Profile Picture
    8,826 Moderator on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans