Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to setup standard Unit Of Measure lookup field for your form

(0) ShareShare
ReportReport
Posted on by 55

Hello, in my custom table I have a custom EDT that is extended from ItemId field, and the standard EDT UnitOfMeasureSymbol. I notice that in some system standard forms such as the Sales Line, when I select an Item, then select the Unit field, it will have an option dropdown where you can choose between Convertible and All.

5633.pastedimage1622702942965v1.png

While in my custom form, my Unit field does not have this option dropdown. 

8357.pastedimage1622703009354v2.png

I have already checked that my Item has Unit Conversion setup, what do I need to do the have the option dropdown like the standard?

  • MinhPham96 Profile Picture
    55 on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    Hmm new update, So in my custom table, I decided to do the following tests and got these results:

    1. I created a relation to UnitOfMeasure table => still could not load the UnitOfMeasureLookup form
    2. I added the standard EDT ItemId to my table and add it to the form (the custom EDT is currently named GameId), => the UnitOfMeasureLookup form loaded when I chose Item in ItemId field.
    3. I removed the standard EDT ItemId from my custom table, and renamed my custom EDT from GameId to ItemId => the UnitOfMeasureLookup form loaded when I chose Item in my custom field

    Do you think this is a standard behavior?

  • MinhPham96 Profile Picture
    55 on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    I disabled the option, rebuilt the UnitOfMeasure package, restarted VS and tried to debug again, but still could not debug.

  • Martin Dráb Profile Picture
    233,066 Most Valuable Professional on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    Not being able to debug standard code is a big problem; it's worth spending some time to get it resolved.

    Try unchecking "Enable Just My Code" (Tools > Options > Debugging > General). Then detach the debugger and attach it again.

    You may also try rebuilding UnitOfMeasure package.

  • MinhPham96 Profile Picture
    55 on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    I had that option disabled, and I tried to edit the unit in the Sales Order Lines, but the form just loaded and the debugger did not get in the break point, the break point was still white.

  • Martin Dráb Profile Picture
    233,066 Most Valuable Professional on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    It might mean that your code isn't using this form. Try it from sales line or somewhere where you're getting the filter.

    If you have a problem with debugging, the first thing to check is that you don't have enabled "Load symbols only for items in the solution" (Dynamics 365 > Options > Debugging).

  • MinhPham96 Profile Picture
    55 on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    Hi, sorry that I misunderstood your point, so I opened the UnitOfMeasureLookup form and placed a break point in the init(), but it seemed that the debugger could not get in the break point, I have checked with my class and I can debug them, but not for this one. 

    pastedimage1622792646721v1.png

    I also made sure that I have the UnitOfMeasure package referenced, and I also rebuilt the model

    pastedimage1622792698608v2.png

    pastedimage1622792707303v3.png

    But I still can not debug the form, do you have any suggestion for this case?

  • Martin Dráb Profile Picture
    233,066 Most Valuable Professional on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    You didn't have to check that - it's a standard EDT and I already said that it's configured in this way. But it's not clear whether you're using this EDT at all and whether you don't have lookup() overridden.

    I said something else. Your first step should be checking if UnitOfMeasureLookup is used or not. For example, put a breakpoint to init() method (or so) and run the lookup with the debugger attached. Your next step depend on the result of the first step.

  • MinhPham96 Profile Picture
    55 on at
    RE: How to setup standard Unit Of Measure lookup field for your form
    [quote]

    Please verify that your lookup is opening UnitOfMeasureLookup form. It should be the case, if you're using the right EDT (and you didn't override the lookup), because both UnitOfMeasureRecId and UnitOfMeasureSymbol EDTs have Form Help = UnitOfMeasureLookup.

    If you're getting the right form, you'll have to find out why switchView control isn't visible.

    If your lookup isn't using the right form, it explains why you don't see the filter.

    [/quote]

    Hi  I checked my UnitOfMeasureSymbol EDT and confirmed that the Form Help is UnitOfMeasureLookup, this does not solve the problem 

    pastedimage1622769663295v1.png

  • Martin Dráb Profile Picture
    233,066 Most Valuable Professional on at
    RE: How to setup standard Unit Of Measure lookup field for your form

    Please verify that your lookup is opening UnitOfMeasureLookup form. It should be the case, if you're using the right EDT (and you didn't override the lookup), because both UnitOfMeasureRecId and UnitOfMeasureSymbol EDTs have Form Help = UnitOfMeasureLookup.

    If you're getting the right form, you'll have to find out why switchView control isn't visible.

    If your lookup isn't using the right form, it explains why you don't see the filter.

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,469 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,066 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans