Hi All,
I'm fairly new with NAV Coding. Can you please tell me what I'm doing wrong:
I want to calculate the SUM of quantities in "Item Ledger Entry" filtered by the Users "Shortcut Dimension 1 Code".
In the Item Table Fields are:
- "Global Dimension 1 Filter" (for filtering)
FieldClass = FlowFilter
TableRelation = "Dimension Value".Code WHERE (Global Dimension No.=CONST(1))
- "InvQty" (for getting the sum of quantity)
FieldClass = FlowField
CalcFormula(Sum("Item Ledger Entry".Quantity WHERE (Item No.=FIELD(No.),Global Dimension 1 Code=FIELD(Global Dimension 1 Filter)))
In the List Page I did this
- OnOpenPage
IF UserSetup.GET(USERID) THEN
VALIDATE("Global Dimension 1 Filter",UserSetup."Shortcut Dimension 1 Code");
MESSAGE('%1',"Global Dimension 1 Filter"); -- Just for checking if getting the correct data
What am I doing wrong. I'm getting the total of all quantity and not filtered by "Shortcut Dimension 1 Code"
Thanks.
0
Answers
> User setup - Shortcut Dimension 1 Code).
> Item - InvQty.
Try This -
IF UserSetup.GET(USERID) THEN
Item.SetFilter("Global Dimension 1 Filter",UserSetup."Shortcut Dimension 1 Code");
Item.Caclfields( InvQty);
Let us know how it goes.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
No haven't read any programming guide specific to NAV. I've been searching for books and reading online blogs to learn more about NAV programming.
Thanks.
UserSetup.GET(USERID);
SETFILTER("Global Dimension 1 Filter",UserSetup."Global Dimension 1 Code");