FlowField sum question

siimsand
Member Posts: 28
Hello,
I have this sum check in code, which is executed when the button "Release" is pressed in Purchase Orders.
IF VendorPurchaseContract.Amount <> 0.0 THEN BEGIN
PurchaseHeader.CALCFIELDS(Amount);
IF PurchaseHeader.Amount > VendorPurchaseContract.Amount THEN
PurchaseHeader.FIELDERROR(Amount,Text006);
END;
In this check I also want to include a check where
'IF VendorPurchaseContract.Amount > (Amount in PurchaseHeader + the sum of amounts in already released purchases with the same Buy-from Vendor No. + the sum of amounts in already posted purchase invoices with the same Buy-from Vendor No.) THEN
FIELDERROR(Amount,<Text>)'
The Amount fields in these tables are FlowFields, but still kind of confuse me if it would be better to filter and sum them up with repeat-until and store them into variables or use CALCFIELDS. Any ideas/code examples?
Thanks in advance.
I have this sum check in code, which is executed when the button "Release" is pressed in Purchase Orders.
IF VendorPurchaseContract.Amount <> 0.0 THEN BEGIN
PurchaseHeader.CALCFIELDS(Amount);
IF PurchaseHeader.Amount > VendorPurchaseContract.Amount THEN
PurchaseHeader.FIELDERROR(Amount,Text006);
END;
In this check I also want to include a check where
'IF VendorPurchaseContract.Amount > (Amount in PurchaseHeader + the sum of amounts in already released purchases with the same Buy-from Vendor No. + the sum of amounts in already posted purchase invoices with the same Buy-from Vendor No.) THEN
FIELDERROR(Amount,<Text>)'
The Amount fields in these tables are FlowFields, but still kind of confuse me if it would be better to filter and sum them up with repeat-until and store them into variables or use CALCFIELDS. Any ideas/code examples?
Thanks in advance.
0
Answers
-
Is your check supposed to include posted invoices amount?Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek_Guzek wrote: »Is your check supposed to include posted invoices amount?
Yes, the sum of the amounts with the same Vendor No. in the Posted Purchase Invoices (in classic client) in the IF-sentence's condition.0 -
it would be better as far as the posted purchase invoices go to have a look at the ledger entries as the documents can be removed when printed.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions