Options

Check Inventory when Delete Item Variant

elToritoelTorito Member Posts: 191
However is possible delete an Variant Code from an Item if them has Inventory <>0.

Which Function can I Call or Modify so before Delete, it checks if they are Inventory <>0 and if Are Items with Variants in Order or in other Use ?

Thanks.
(Oo)=*=(oO)

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,090
    I am afraid you have to write the code yourself. Something like:

    rec32.RESET;
    rec32.SETCURRENTKEY("Item No.","Variant Code");
    rec32.SETRANGE("Item No.",'My Item No.');
    rec32.SETRANGE("Variant Code",'My Variant Code');
    rec32.CALCSUMS(Quantity);
    IF rec32.Quantity <> 0 THEN
    MESSAGE('Quantity is not 0');

    If there is a quantity different from 0, you have to make item-postings to bring it to 0.

    rec37.RESET;
    rec37.SETCURRENTKEY(Type,"No.","Variant Code");
    rec37.SETRANGE(Type,rec37.Type::Item);
    rec37.SETRANGE("No.",'My Item No.');
    rec37.SETRANGE("Variant Code",'My Variant Code');
    IF rec37.FIND('-') THEN
    MESSAGE('There are %1 records in table 37',rec37.COUNT);

    and the same test for table 39.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    elToritoelTorito Member Posts: 191
    Hmm. Perhaps it can be Use Form 342 (Check Avaibility) ...

    I'm checking at time if i can use it...
    (Oo)=*=(oO)
  • Options
    elToritoelTorito Member Posts: 191
    kriki wrote:
    I am afraid you have to write the code yourself. Something
    and the same test for table 39.

    Well , i have now Code myself ... the solution with the form 342 and CU 311 likes Nice, but its me at moment to complicated modify / add any source


    8-[ :mrgreen:

    Thanks for you answer and tipp
    (Oo)=*=(oO)
Sign In or Register to comment.