FlowField as the SumIndexField
Andwian
Member Posts: 627
Dear Experts,
I create a new FlowField "Balance at Date" in Customer table :
Hence, I created the SumIndexField, but there is another error:
Hence, the "Balance at Date" must be changed to:
Is there any other way?
Thank you for your helps.
I create a new FlowField "Balance at Date" in Customer table :
Sum("Cust. Ledger Entry"."REMAINING AMOUNT" WHERE (Customer No.=FIELD(No.),Due Date=FIELD(UPPERLIMIT(Date Filter))))
But when I run the Customer table, the error arouse:
As I understand, this is because there is no SumIndexField for Remaining Amount.
Microsoft Dynamics NAV
The FlowField value cannot be calculated.
You must define and activate a key that contains the key fields that appear below (the order is unimportant) and then associate the specified SumIndexField with it.
Key Fields: Customer No.
SumIndexField: Remaining Amount
Table: Cust. Ledger Entry
OK
Hence, I created the SumIndexField, but there is another error:
This is because, the FlowField could not be the SumIndexField.
Microsoft Dynamics NAV
A FlowField cannot be a SumIndexField.
Field: Remaining Amount
Table: Cust. Ledger Entry
Key fields: Entry No.
OK
Hence, the "Balance at Date" must be changed to:
Sum("Cust. Ledger Entry"."AMOUNT" WHERE (Customer No.=FIELD(No.),Due Date=FIELD(UPPERLIMIT(Date Filter))))
Is there any other way?
Thank you for your helps.
Regards,
Andwian
Andwian
0
Answers
-
1) you can't create a SIFT on a flowfield.
2) your new field "Balance At Date" in the customer table should point to the "Detailed Cust. Ledg. Entry"-table.
probably you need something like:
Sum("Detailed Cust. Ledg. Entry".Amount WHERE (Customer No.=FIELD(No.),Due Date=FIELD(UPPERLIMIT(Date Filter))))
The problem is that you don't have "Due Date" in the "Detailed Cust. Ledg. Entry"-table.
To fix this, you can create the field, maintain it and put the correct indexes on the table. I would try to avoid this approach because the "maintain it" will be the pain-point.
Another way is to create a function in the customer table with the logic to calculate the value you want.
Something like :
CalculateBalanceAtDate(IcodCustomerNo,IdatDueDate) AS Decimal
And in this function you read the customer ledger entries and calculate the "Remaining Amount" for each customer ledger entry.
BTW: Do you really need to filter on "Due Date"? If Posting Date is ok, your new flowfield can have this formula:
Sum("Detailed Cust. Ledg. Entry".Amount WHERE (Customer No.=FIELD(No.),Posting Date=FIELD(UPPERLIMIT(Date Filter))))Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I want to check the Overdue Balance of the customer, as of the WORKDATE. If we use this Calculation Formula, the Late Payment (i.e. the posting date of the payment is later than the Invoice's due date), then the payment is not recognized, and the invoice is recognized as open still.kriki wrote:BTW: Do you really need to filter on "Due Date"? If Posting Date is ok, your new flowfield can have this formula:
Sum("Detailed Cust. Ledg. Entry".Amount WHERE (Customer No.=FIELD(No.),Posting Date=FIELD(UPPERLIMIT(Date Filter))))
Refer to this:
Show Open Entries Only in Report Customer Detailed AgingRegards,
Andwian0 -
Maybe better use a function to calculate.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote:
Another way is to create a function in the customer table with the logic to calculate the value you want.
Something like :
CalculateBalanceAtDate(IcodCustomerNo,IdatDueDate) AS Decimal
And in this function you read the customer ledger entries and calculate the "Remaining Amount" for each customer ledger entry.
:thumbsup: This is the way I would do it. (I was going to make a similar post).David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
