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() function usage to calculate field value

(1) ShareShare
ReportReport
Posted on by 160
can you please explain how Lookup() works in Business Central AL Code?
I am trying to understand the following code:-
 
CalcFormula = Lookup(/Sales Shipment Header/./Shipment Date/ where(/No./ = field(/Last Shipping No./)));
 
According to my understanding,
This function will return Shipment Date. but how it is able to filter? I am not able to understand /where/ part.
one thing I am sure of ,the two fields inside where will have same datatype, one is from sales shipment header and other one will from Sales Header table as this code is from SalesHeader.dal
 
Can someone please explain me this?
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    25,157 Most Valuable Professional on at
  • Suggested answer
    Dustin Wolf Profile Picture
    30 on at
    In this instance, the look up is going to a specific record, and since you have Sales Shipment Header . Shipment Date, the look up is specifically looking for that field from that record.

    the Where is basically telling the system the specifics.

    Where(  "No." (the sales shipment No.) = field(" Last Shipping No. ") (the field on the sales header) )
    this tells the calcformula that it has a 1 to 1 relationship.  So it knows how to pull that specific shipment, and the specific date.
     
     
    Dustin Wolf, MS
    Senior Developer
    Accent Software, Inc.
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at
    Hi, If you can use VLOOKUP in Excel, this part can be understood as finding Lookup value (3) in Lookup column (ID), and Sales Shipment Header.Shipment Date is Result.
     
    Hope this can give you some hints.
    Thanks.
    ZHU

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans