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

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans