Skip to main content

Notifications

Announcements

No record found.

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")));


 
        }
  
  • Ramiz Profile Picture
    Ramiz 344 on at
    Flow Field Cal Formula
    Hi,

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

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 4,753 on at
    Flow Field Cal Formula
    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.
  • PC-25110502-0 Profile Picture
    PC-25110502-0 9 on at
    Flow Field Cal Formula
    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. 
     
  • RB-10051553-0 Profile Picture
    RB-10051553-0 30 on at
    Flow Field Cal Formula
    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
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 4,753 on at
  • gdrenteria Profile Picture
    gdrenteria 12,338 Most Valuable Professional on at
    Flow Field Cal Formula
    Hi
    what is the error message?
    Best
    GR
  • Suggested answer
    Praveen S Profile Picture
    Praveen S 26 on at
    Flow Field Cal Formula
    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/

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans