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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Simple lookup Customization for Item Unit of Measure

(1) ShareShare
ReportReport
Posted on by 74
Hi All,
 
I got a request from a customer who wishes to hide a unit of measurement option from certain items. The issue here being that the unit of measure that needs to be disabled from use already has item ledger entries. For some reason they do not want to create a new item. For all outbound documents they want to be able to hide a certain unit of measure for a specific item or items. 
 
My approach was:
  1. Extend the item unit of measure table with a boolean field called Hide
  2. Extend the Page Item units of Measure with the same field
  3. Extend Table 37-Sales Line Table - on field 5407-Unit of Measure Code [10]. By changing the table relation property
To my understanding this should be enough to manipulate the lookup behaviour on the Saler Orders Page from with the Sales Lines Sub Form. 
 
here is my table relation Code:
if (Type = const(Item)No. = filter(<> '')) Item Unit of Measure Code where(Item No. = field(/No.))if (Type = const(Item)No. = filter(<> '')) Item Unit of Measure Code where(Item No. = field(/No.), Hide = const(false))
In the edited code I added the /Hide = Const(false)/ into code. I would expect that when looking up the Item unit of measure from the /Unit Of Measure Code/ field on the Sales Line Page, it nof only filters on the /Item No./ = field(/No./), but also on the Hide = Const(false)) field. This does not seem to take effect. 
 
Any suggestions and help would be much appreciated.  The only thing I am still considering is trying to Modify the OnLookUp trigger on the Unit Of Measure Code field on the Sales Order Subform, which has the Sales Line Table as a source. However, I have no idea on what code or logic I should be adding there when I already edited the table relation property for the Unit of Measure Code field on the source table.    
 
Update: 
The code formatter displays the code in a weird way. Here is the code without the code editor:
if (Type = const(Item),
                                No. = filter(<> '')) Item Unit of Measure.Code where(Item No. = field(No.))
            else
            if (Type = const(Resource),
                                         No. = filter(<> '')) Resource Unit of Measure.Code where(Resource No. = field(No.))
            else
            if (Type = filter(/Charge (Item)/ | /Fixed Asset/ | /G/L Account/)) /Unit of Measure/
 
 
--Edited Code
 
if (Type = const(Item),
                                No. = filter(<> '')) Item Unit of Measure.Code where(Item No. = field(No.), Hide = const(false))
            else
            if (Type = const(Resource),
                                         /No./ = filter(<> '')) /Resource Unit of Measure/.Code where(/Resource No./ = field(/No./))
            else
            if (Type = filter(/Charge (Item)/ | /Fixed Asset/ | /G/L Account/)) /Unit of Measure/;
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    102,361 Super User 2026 Season 1 on at
    Hi, hope the following helps.
    Dynamics 365 Business Central: Can we extend TableRelation Property through a table extension??? (Yes, But…)
     
    However, if you have added a new field, it is recommended to use the Security Filter feature. This way no customization is required, only permissions need to be set.
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Zafar LIT Profile Picture
    74 on at
    Apologies. I will look into the links and feedback and circle back if this solves the problem. I do not seem to be getting any notifications when someone replies. Need to check why that happens. Thank you for your reply.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 649 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 388 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans