Field validation when using dataports

I have had bad experiences when using dataports to import information into Journals. The reason for this was validations on fields within journal line table. Has anyone any recommeded ways of dealing with this issue ? i.e. The best way to find what fields require validating so that they update other fields on the journal, and also what experiences or suggestions others may have. Many Thanks

A good way of learning, is document the steps you have to do when keying in information manually. Eg. posting date, document type, document no., account type, amount This would probably be the same order you have to validate your fields when importing. Remember to set CallFieldValidate property for the fields you would like to validate on import. Soren Nielsen, moderator Integration/Developer NOLUG

I always create a buffer table when I’m importing into i.e. a journal or order. This way I’m able to do a much better pre-validation and not just give a run-time error, but create a detailed error listing. Then I’m able to tell the user exactly why the data cannot be imported, what record/line that gives the error. It also allow me to create a nice codeunit to create the actual record, i.e. the journal. A good way to learn how to create the journal lines is to look at what Navision Financials does. If i.e. you’re importing into the Item Journal, then try to take a look at report 790 (Calculate Inventory). This actually creates the lines, so you can see what you need to do. Best regards, Erik P. Ernst, webmaster Navision Online User Group

Just validate the fields required Example: If we was Importing Opening Sales Documents OnPreDataPort set your defaults “Gen. Journal Line”.Template:=‘SALES’; “Gen. Journal Line”.Batch:=‘OPENING’; “Gen. Journal Line”.Type:=“Gen. Journal Line”.Type::Customer; “Gen. Journal Line”.“Bal. Type”:=“Gen. Journal Line”.Type::“Account G/L”; “Gen. Journal Line”.“Bal. No.”:=BalAccount; ETC: ETC: NextLineNo:=0; OnAfterImportRecord() TempDescription:=Description; NextLineNo:=NextLineNo+10000; “Line No.” := NextLineNo; Validate(“No,”) will run the trigger code for the customer, giving an error for bad data! Replace the Description with the posting description Description:=TempDescription: Blank out VAT posting groups to post only the value (No VAT) then balance to a suspense account David Cox MindSource (UK) Limited Navision Solutions Partner Email: Web: Edited by - David Cox on 2001 Mar 22 22:53:20