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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Lookup No field based on type in lines(subform) development

(0) ShareShare
ReportReport
Posted on by 25

How this logic work based on type no. is changed.

Thank You.

pastedimage1651120754635v2.png

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    150 on at

    This is how the sales line handles it:

    field(6; "No."; Code[20])
    {
    CaptionClass = GetCaptionClass(FieldNo("No."));
    Caption = 'No.';
    TableRelation = IF (Type = CONST(" ")) "Standard Text"
    ELSE
    IF (Type = CONST("G/L Account"),
    "System-Created Entry" = CONST(false)) "G/L Account" WHERE("Direct Posting" = CONST(true),
    "Account Type" = CONST(Posting),
    Blocked = CONST(false))
    ELSE
    IF (Type = CONST("G/L Account"),
    "System-Created Entry" = CONST(true)) "G/L Account"
    ELSE
    IF (Type = CONST(Resource)) Resource
    ELSE
    IF (Type = CONST("Fixed Asset")) "Fixed Asset"
    ELSE
    IF (Type = CONST("Charge (Item)")) "Item Charge"
    ELSE
    IF (Type = CONST(Item),
    "Document Type" = FILTER(<> "Credit Memo" & <> "Return Order")) Item WHERE(Blocked = CONST(false),
    "Sales Blocked" = CONST(false))
    ELSE
    IF (Type = CONST(Item),
    "Document Type" = FILTER("Credit Memo" | "Return Order")) Item WHERE(Blocked = CONST(false));

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,161 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,046 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 932 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans