Check Flowfield Quantity on Bin Content

rossalerossale Member Posts: 26
Hi!
i have to check the quantity on BinContent table before deleting the item, how can I do? I try to use the "calcfields" but it doesn't seems to work.

This is the code:
BinContent.SETRANGE("Item No.", Item."No.");

BinContent.CALCFIELDS(BinContent.Quantity);

//IF (BinContent.FIND('-')) THEN
IF BinContent.FINDSET THEN
BEGIN  
   IF (BinContent.Quantity = 0) THEN
    BEGIN
       BinContent.DELETE(TRUE);
    END
   ELSE
    BEGIN
      CurrDataport.SKIP;
    END;
END;


Thanks

Alex

Comments

  • krikikriki Member, Moderator Posts: 9,110
    I suppose this is what you wanted to do?
    BinContent.RESET;
    BinContent.SETCURRENTKEY("Item No.");
    BinContent.SETRANGE("Item No.", Item."No.");
    BinContent.CALCFIELDS(Quantity); // make total per item
    IF BinContent.Quantity = 0 THEN // check the total
      BinContent.DELETEALL(TRUE)
    ELSE
      CurrDataport.SKIP;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rossalerossale Member Posts: 26
    Thanks
    now I try....

    GRAZIE !
  • rossalerossale Member Posts: 26
    It doesn't work... :cry:
    I don't know why !!
    If I go in the BIN CONTENT table and I look for the "Item No." desired, the "Quantity" seems to be 4 Item, but if I debug the quantity is 0........
    and obviously the Dataport try to delete, but when the trigger "OnDelete" of the table 7302 Bin Content start the "Quantity", correctly, is 4 and then dump....

    :?:
  • krikikriki Member, Moderator Posts: 9,110
    If your DB is SQL and you have not 4.00SP3, do an optimize of the table in File=>Database=>Information=>Tables=>button optimize.
    This should fix the SIFT-information on SQL. Probably this is wrong because of a bug.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rossalerossale Member Posts: 26
    #-o mmmm Unfortunatelly, we have NAV 4.00 SP3..

    Now I try to workaround the problem by take the information of "Quantity" in another table (the "Inventory" Field on "ITEM")... seems working, but is a very very strange way.... :(
Sign In or Register to comment.