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

Flow Field Cal Formula

(1) ShareShare
ReportReport
Posted on by 30
Hi,
I need to create flow field on purchase line to map Direct Unit Cost from "Purchase Price" table. In order to do this I have to match the Item No, Buy-From Vendor No_ with "Purchase Line" table, and make sure price's are in the current Date Range. Here is My Code below, I am getting error's on this can some one please help. I haven't done CalcFormula with multiple conditions before.
 
           field(50015; "DirectUnitCost"; Text[100])
        {
            Caption = 'Direct Unit Cost';
            FieldClass = FlowField;
            Editable = False;
         
          CalcFormula = Lookup("Purchase Price"."Direct Unit Cost" where("Item No_" = field("Item No."),("Vendor No_" = field("Buy-From Vendor No."), Current Date >=field("Ending Date")));


 
        }
  
I have the same question (0)
  • Suggested answer
    Praveen S Profile Picture
    26 on at
    Hello,
     
    Due to version upgrade in business central, Purchase Price Objects has been upgraded with new table hierarchy
    Please use Price List Line table to fix this issue and based on your requirement change the Where Clause filters accordingly.
    Below Warning for reference,
     
     
    Table 'Purchase Price' is marked for removal. Reason: Replaced by the new implementation (V16) of price calculation: table Price List Line. Tag: 16.0.ALAL0432
     
     
    Hope this Helps!
     
    Kind Regards,
    Praveen S
    Congruent Info-tech - https://www.congruentsoft.com/
  • Gerardo Rentería García Profile Picture
    25,236 Most Valuable Professional on at
    Hi
    what is the error message?
    Best
    GR
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,604 Super User 2025 Season 2 on at
  • RB-10051553-0 Profile Picture
    30 on at
    These are the errors I am getting, it may be I am not using the "Current Date" function correctly  I wanted to match "Ending Date" against the todays Date.
    And the other error is this one
     
  • PC-25110502-0 Profile Picture
    75 on at
    Hi,
     
    The problem is the "Current Date" part of your code.
     
    You can't use a function in a CalcFormula, needs to be a field & some type of filter. 
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,604 Super User 2025 Season 2 on at
    The current date cannot be directly used as a filter since it requires a constant value. To work around this, you can create a calculated field as a variable, compute its value in the OnAfterGetRecord trigger of the page, and then use it for filtering. This field will exist only at the page level, not in the underlying table.
  • Ramiz Profile Picture
    597 on at
    Hi,

    You can view that information in the purchase line details factbox.

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,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans