web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Suggested answer
    YUN ZHU Profile Picture
    91,408 Super User 2025 Season 2 on at
    LookUp() function usage to calculate field value
    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
  • Suggested answer
    Dustin Wolf Profile Picture
    30 on at
    LookUp() function usage to calculate field value
    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.
  • Gerardo Rentería García Profile Picture
    23,454 Most Valuable Professional on at
    LookUp() function usage to calculate field value

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,406

#2
Sumit Singh Profile Picture

Sumit Singh 2,852

#3
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 2,217

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans