Navision Bug, or my Progamming Error?

elTorito
Member Posts: 191
Hi,
I Have trouble with some Function i have programmed. Perhaps you can help me.
With Transfer Orders we put Items in an Inventory, are Items that we can not Sale, because are broken or what ever, after check the items, this Inventory must be put to 0. So we do it with an Item Journal, for clean the Inventory.
Now i have programmed some function for fill the Item Journal, that we only must book it out, but it seems that my function doesn't fill the field Quantity (Base) , so it exists an Item Ledger Entry with Quantity 0 but an Value Not Zero. So i have Inventory Quantity with 1.
Then i fill Item Journal Line manually with Quantity 1 and Value 0. After this, Quantity in inventory was 0, but i don#t know that makes the adjust cost - item entrys, because after run Report 1001 i have quantity -1 and cost posted to G/L are negative.
I find it curiosly that Navision book the Lines with Quantity Base = 0
Well, perhaps anyone can say me how i cann correct my function so it fills Quantity(base) Correctly, Thanks:
I Have trouble with some Function i have programmed. Perhaps you can help me.
With Transfer Orders we put Items in an Inventory, are Items that we can not Sale, because are broken or what ever, after check the items, this Inventory must be put to 0. So we do it with an Item Journal, for clean the Inventory.
Now i have programmed some function for fill the Item Journal, that we only must book it out, but it seems that my function doesn't fill the field Quantity (Base) , so it exists an Item Ledger Entry with Quantity 0 but an Value Not Zero. So i have Inventory Quantity with 1.
Then i fill Item Journal Line manually with Quantity 1 and Value 0. After this, Quantity in inventory was 0, but i don#t know that makes the adjust cost - item entrys, because after run Report 1001 i have quantity -1 and cost posted to G/L are negative.
I find it curiosly that Navision book the Lines with Quantity Base = 0
Well, perhaps anyone can say me how i cann correct my function so it fills Quantity(base) Correctly, Thanks:
ItemLedgerEntry.SETFILTER("Location Code", 'EXIT_INVENTORY'); ItemLedgerEntry.SETFILTER(Open, 'Ja'); IF ItemLedgerEntry.FIND('-') THEN REPEAT ZL += 10000; ItemJournalLine.INIT; ItemJournalLine."Journal Template Name" := 'ITEM'; ItemJournalLine."Journal Batch Name" := 'BOOK_OUT'; ItemJournalLine."Line No." := ZL; ItemJournalLine.INSERT; ItemJournalLine."Document No." := 'DocNo'; ItemJournalLine.VALIDATE("Posting Date",ItemLedgerEntry."Posting Date"); ItemJournalLine.VALIDATE("Entry Type",ItemLedgerEntry."Entry Type"); ItemJournalLine.VALIDATE("Item No.",ItemLedgerEntry."Item No."); ItemJournalLine.VALIDATE("Location Code",'EXIT_INVENTORY'); ItemJournalLine.VALIDATE("Variant Code",ItemLedgerEntry."Variant Code"); ItemJournalLine.VALIDATE("Entry Type",3); ItemJournalLine.VALIDATE(Quantity,ItemLedgerEntry."Quantity (Base)"); ItemJournalLine.VALIDATE("Quantity (Base)",ItemLedgerEntry."Quantity (Base)"); ItemJournalLine.VALIDATE("Applies-to Entry",ItemLedgerEntry."Entry No."); ItemJournalLine.MODIFY; UNTIL ItemLedgerEntry.NEXT=0;:shock:
(Oo)=*=(oO)
0
Comments
-
If you validate the "Unit of Measure Code", it should be sufficient to validate the Quantity. The "Quantity ( Base)" is calculated by the function CalcBaseQty in the Item Journal line if the "Qty. per Unit of Measure" is known.Kai Kowalewski0
-
Kowa wrote:If you validate the "Unit of Measure Code", it should be sufficient to validate the Quantity. The "Quantity ( Base)" is calculated by the function CalcBaseQty in the Item Journal line if the "Qty. per Unit of Measure" is known.
Yes, i have try to intend this, only filling quantity, but doesn't work. Quantity(base) believes 0. And seems that Navision don't check it before booking the lines.(Oo)=*=(oO)0 -
The code on item journal for quantity (base) get calculated here
CalcBaseQty(Qty : Decimal) : Decimal TESTFIELD("Qty. per Unit of Measure"); EXIT(ROUND(Qty * "Qty. per Unit of Measure",0.00001));
So you should get an error when you validate quantity field.
The code onvalidate of quantity field isQuantity - OnValidate() ....code "Quantity (Base)" := CalcBaseQty(Quantity); ..code
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