shelf/bin no.

sanjacsanjac Member Posts: 3
edited 2011-04-30 in Navision Attain
Hello everybody,
I have on the first sight a simple question.
We are using the "shelf/bin no." for simple stockkeeping.
The problem is that the value in this field still is stored even the inventory = 0
As we are working with flexible warehouselocations this is very tricky.
Is there a way to set the value of "shelf/bin no. at '' as soon the inventory = 0.
I tried it with simple solutions as: if inventory = 0 then "self/bin no." := '' but the old
locationnumber comes back as soon the inventory <> 0.

I appriciate every suggetion

Thanks Dirk

Comments

  • sanjacsanjac Member Posts: 3
    Hello,

    I tried a lot of ways to solve this problem and I found one, although it is not the most beautyfull one.
    First is sorted out where the value of the inventory changes:
    This is in codeunit 22, just above
    .InsertItemReg(ItemLedgEntryNo : Integer;PhysInvtEntryNo : Integer;ValueEntryNo
    I placed there the following code, (just after itemregentry.insert):

    IF item.GET("Item No.") THEN
    item.CALCFIELDS(Inventory); // find out if inv. = 0
    IF item.Inventory = 0 THEN BEGIN
    item.VALIDATE(item."Shelf/Bin No.",'');
    END;

    This triggers the Shelf/Bin No. - OnValidate() in table 21 (item)
    there I placed this code
    IF Rec."Shelf/Bin No." <> xRec."Shelf/Bin No." THEN
    IF Inventory = 0 THEN BEGIN
    "Shelf/Bin No.":='';
    FORM.RUN(30,Rec,"Shelf/Bin No.");
    END;

    Finally the following code was placed in form 30 (item card) under Form - OnActivateForm()
    CurrForm.UPDATE(TRUE);
    IF artikel.GET(Rec."No.") THEN
    CALCFIELDS(Inventory);
    IF Inventory = 0 THEN "Shelf/Bin No." := '0000';

    In this way the record with inventory = 0 gets an location nr. '0000'

    But due to the Form.run statement the form 30 appears for every record and has to be remomed by esc.

    My question now is: How can I avoid that?

    Thanks

    Dirk
Sign In or Register to comment.