I have following field in xmlport and want to validate Item No and Quantity. What is the syntax? I wrote below code but its not working.
DefaultFieldsValidation and FieldValidate properties are true.
Thanks in Advance
I guess you are new at programming???? Your code is very wrong. If you do a validate then you have to do your validate like this "Purchase Line".Validate("No.",NEW_VALUE);
(You are not adding a new value
Furthermore why do you want to validate of something you EXPORT?
Don't know what exactly you trying to achieve but even in your Xmlport and on Field level property you will find something which says FieldValidate, if you nable this it will call the OnValidate trigger!!
Which will not be called on exports, only on imports.
The question was yet not clear and he dint explicitly mentioned this.
Thanks Erik for reply.
Sorry for delay in reply.
I am working on xmlport which is used for import the file.
Palle asked that question because he replied one of my previous question on xmlport, but that time I was working on xmlport which i was using for export purpose. So might be Palle mixed my both question.
Thanks for reply Palle.
No, not much new, I will complete one year next month.
But working first time on xmlport. Otherwise used Validate function many times.
This time I am developing xmlport which will import csv file.
So you're trying to import this data into the Purchase Line table?
Then your is (as Palle says it) very wrong.
Even putting your validate on the OnBeforeImport trigger would not help. You can simply not insert purchase lines that way. Even if you had already created the purchase header, then you need to link the lines to the header, update line no., set line type and a lot more.
So please remember to put your questions into context, what is it that you are trying to do and why did you do what you already did. And ALWAYS remember to tag the question with your version! Otherwise you waste ours (and your own) time, by letting us guessing it on our own. Thank you.