OnBeforeEvaluateField IF NOT EVALUATE("Sell-to Customer Name",Text) THEN BEGIN Errors.FIND('+'); NumError := Errors."Line No."; Errors.INIT; //Begin to insert in the "error" table, Errors is a record var Errors."Line No." := NumError + 10000; Errors.Description := STRSUBSTNO('Import error on field %1, [Field Name]',FIELDNAME("Sell-to customer Name"); //Text wich explain what kind of error Errors."Data Type" := 'Text'; //Field type Errors."Incorrect element" := Text; //The text which couldn't be imported Errors.Date := TODAY; //When the error occured Errors.Time := TIME; //When the error occured //Just to know what was the field length : Errors."Field Lenght" := 30; //If i have al lot of tables to import, to know in wich import the error was : Errors."Table Name" := "Sales Header".TABLENAME; //Same idea : in which record the error was : Errors."Record No." := "No."; Errors.INSERT; //To continue the import and not have a navision error message : CurrDataport.SKIP; END;
Comments
If it was hard to write, it should be hard to understand."