My navision get closed when i select the variant code in production order line, Any solutions.

I am working in navision 2013r2 when i select the variant code in production order line my navision gets closed. My table no is 5406 i.e Prod. Order Line.

Best Answer

Answers

  • Seemab07Seemab07 Member Posts: 32
    After compiling the table its work fine..
  • Seemab07Seemab07 Member Posts: 32

    TESTFIELD("Finished Quantity",0);
    CALCFIELDS("Reserved Quantity");
    TESTFIELD("Reserved Quantity",0);
    WhseValidateSourceLine.ProdOrderLineVerifyChange(Rec,xRec);

    IF "Variant Code" = '' THEN BEGIN
    VALIDATE("Item No.");
    EXIT;
    END;
    ItemVariant.GET("Item No.","Variant Code");
    Description := ItemVariant.Description;
    "Description 2" := ItemVariant."Description 2";

    The following code is written on validate.
  • Seemab07Seemab07 Member Posts: 32
    i need a permanent solution same thing happening everytime i have to compile the table
    i.e production order line.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Is that all the code in Variant Code - OnValidate in your version?

    I don't have 2013R2, but in 2017 there are 2 more lines of code. If you have them perhaps the problem is somewhere in functions called at the end of OnValidate.

    As I've said in cases I have seen the problem was not in the code, but in the metadata. For example - one place calling some function in some other codeunit, and in this called function there was a variable based on some table, and the table was not compiled. The table variable has not been even used in the code, was just a leftover after some other removed bits of code, yet it had an impact.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.