...
EmptyLineFound := FALSE;
WITH SalesLine DO BEGIN
RESET;
SETRANGE("Document Type",SalesHeader."Document Type");
SETRANGE("Document No.",SalesHeader."No.");
IF FIND('-') THEN REPEAT
IF (Type <> Type::" ") AND ("No." <> '') AND ("Unit of Measure" = '') THEN
ERROR(Text13612,"Document Type","Document No.",FIELDCAPTION("Unit of Measure"));
IF Description = '' THEN
IF (Type <> Type::" ") AND ("No." <> '') THEN
ERROR(Text13608,"Document Type","Document No.",
FIELDCAPTION(Type),FIELDCAPTION("No."),FIELDCAPTION(Description));
// Delete the following lines.
IF "Line Amount" < 0 THEN
ERROR(Text000,FIELDCAPTION("Line Amount"),"Line No.");
// End of the lines.
LineAmount += "Line Amount";
IF (Type = Type::" ") OR ("No." = '')
THEN EmptyLineFound := TRUE;
UNTIL (NEXT = 0);
IF EmptyLineFound THEN
...
...
EmptyLineFound := FALSE;
// Add the following line.
CLEAR(LineAmount);
WITH SalesLine DO BEGIN
RESET;
SETRANGE("Document Type",SalesHeader."Document Type");
SETRANGE("Document No.",SalesHeader."No.");
IF FIND('-') THEN REPEAT
IF (Type <> Type::" ") AND ("No." <> '') AND ("Unit of Measure" = '') THEN
ERROR(Text13612,"Document Type","Document No.",FIELDCAPTION("Unit of Measure"));
IF Description = '' THEN
IF (Type <> Type::" ") AND ("No." <> '') THEN
ERROR(Text13608,"Document Type","Document No.",
FIELDCAPTION(Type),FIELDCAPTION("No."),FIELDCAPTION(Description));
LineAmount += "Line Amount";
IF (Type = Type::" ") OR ("No." = '')
THEN EmptyLineFound := TRUE;
UNTIL (NEXT = 0);
// Add the following lines.
IF LineAmount < 0 THEN
ERROR(Text000);
// End of the lines.
IF EmptyLineFound THEN
...