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.
In my experience it happens sometimes (client closing pages or crashes) when a code touches an object, which has invalid references - a variable defined based on non-compiled table or page, a field having a relation to non-existing table or field - by the way, the latter may not pop-up during compilation.
In my experience it happens sometimes (client closing pages or crashes) when a code touches an object, which has invalid references - a variable defined based on non-compiled table or page, a field having a relation to non-existing table or field - by the way, the latter may not pop-up during compilation.
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.
Answers
In my experience it happens sometimes (client closing pages or crashes) when a code touches an object, which has invalid references - a variable defined based on non-compiled table or page, a field having a relation to non-existing table or field - by the way, the latter may not pop-up during compilation.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
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.
i.e production order line.
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.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03