dataport

Hello to all, use Dynamics Nav 5.0 recently.

I often import data from Excel to store —> CSV (CodItem and Q.ty) using a dataport, and every time to clear the previous quantities are forced to make a negative adjustment and then drawn into the new levels.

It 's possible that the same dataport reset all of the stock before the new import?

Thanks in advance

KennyD

How do you import the quantities? Are you creating item ledger entries manually or are you filling in a journal and post this?

Whit Item Journal Line:

OnBeforeImportRecord:

gIntLineNo+=10000;
INIT;
“Journal Template Name”:=‘Art’;
“Journal Batch Name”:=‘DEFAULT’;
“Line No.”:=gIntLineNo;
“Posting Date” := WORKDATE;
“Entry Type” := “Item Journal Line”.“Entry Type”::“Positive Adjmt.”;
“Document No.” := ‘Warehose’;

OnAfterImportRecord:

VALIDATE(“Item No.”,gCodItem);
VALIDATE(“Unit Amount”,gDecCost);
VALIDATE(Quantity,gDecQty);
VALIDATE(“Location Code”,gCodLocationCode);
INSERT;

Thanks Agian for your attention

Kenny

OK, Try the following in the “OnAfterImportRecord”:

VALIDATE("Item No.",gCodItem);
Item.GET(gCodItem);
Item.SETRANGE("Location Filter", gCodLocationCode);
Item.CALCFIELDS("Net Change");
VALIDATE("Unit Amount",gDecCost);
VALIDATE(Quantity,gDecQty - Item."Net Change");
VALIDATE("Location Code",gCodLocationCode);
INSERT;

This code change will enable you to just post the difference between the old and the new quantity - so you don’t need to clear the quantity every time.

On the other hand, WHY do you do it this way?

Why do you have to imort quantities anyway?

I created a store with new codes to simulate the WIP, so every day the warehouse unloading and reloading with the new levels.

Thanks a lot for your great help, i keep you informed.

Kenny

Sorry maybe is very important to say that i import only the code with the quantity >0 , for this is better to clear everytime all the quantity in the warehouse

Thanks again

Kenny

But again: why do you need to keep track of the quantity on stock outside of Navision? What exactly do you mean by “store”?

I perceive there might be an easier way to go about the process. However, there is need for a clearer specification.

However, taking a shot at it this is what could be done.

Kindly correct me if I am wrong, it seems there are two systems one is Navision and the other is the Warehouse system. CSV is being used on daily basis to update Navision from the other system.

If the above is correct what is being done it to clear the value in Navision and update it with the current value from the other system.

Given that the above is the correct description of the situation:

Your question : It 's possible that the same dataport reset all of the stock before the new import?

Answer : Yes it is possible.

Option 1: All Items in the inventory

If you are looking at the whole inventory Physical inventory adjustment batch could be used to do this. This you run before you run you dataport to set the inventory to zero.

Option 2: Certain inventory Qty>0

Option 2.1 If you want the day’s updated Item quantity to reflect

During the dataport import, 2 journals would be created one is to clear the current balance (Negative Adjst.) ; the second is to update the new balance (Positive Adjst.). |Alternatively, two lines are created for each item in the same journal first line clear the old balance the second line update the new balance.

Option 2.2 ====> Option1 and Option 2.1 together

If you choose to create physical inventory adjustment journal, you can actually direct you dataport to look for the items in the journal and update the quantity by the one from CSV. After updating the entry you simply post the Inventory Adjustment Journal