I'm getting an error in NAV 2015 on a custom import codeunit I wrote. I've done this a hundred times, but am getting a message I can't figure out. I keep getting that the sales line does not exist... funny this is that the debugger shows that the line is active and the code itself would suggest that we're on it.
code snippet follows:
SalesLine.RESET;
SalesLine.SETRANGE("Document Type", SalesHeader."Document Type");
SalesLine.SETRANGE("Document No.", SalesHeader."No.");
SalesLine.SETRANGE("Line No.", SalesLineImport."Line No.");
IF SalesLine.FINDFIRST THEN BEGIN
SalesLine.SetHideValidationDialog(TRUE);
SalesLine.VALIDATE("Location Code", '04');
SalesLine.VALIDATE("No.", Item."No.");
SalesLine.VALIDATE(Description, SalesLineImport.Description);
SalesLine.VALIDATE("Requested Delivery Date", SalesLineImport."Requested Shipment Date");
SalesLine.VALIDATE("Unit of Measure", SalesLineImport."Unit of Measure");
SalesLine.VALIDATE(Quantity, SalesLineImport.Quantity);
SalesLine.MODIFY;
END ELSE BEGIN
*This post is locked for comments
I have the same question (0)