Just copy the validation from where it currently exist, create something similar in the web service and utilize it before the create/update function in the web service. This, of course, means it will be inefficient since it's having to do the same thing twice but it does what you're asking. You can get around the inefficiency but you have to ask yourself how often it happens and whether it's worth it with a little more programming.
vinceliu666 wrote: »Just copy the validation from where it currently exist, create something similar in the web service and utilize it before the create/update function in the web service. This, of course, means it will be inefficient since it's having to do the same thing twice but it does what you're asking. You can get around the inefficiency but you have to ask yourself how often it happens and whether it's worth it with a little more programming.
Thanks for your feedback , My Issue is that if I run record.insert, the record will be inserted. But I just want to validate data only, not insert record. If I run the record.insert , I must delete the record after insert . But the autoasign no for example Sales Order No will be add one.
Answers
Thanks for your feedback , My Issue is that if I run record.insert, the record will be inserted. But I just want to validate data only, not insert record. If I run the record.insert , I must delete the record after insert . But the autoasign no for example Sales Order No will be add one.
The only way around that would be to implement your own AL function that does the wished validation for you - without actually inserting - which honestly sounds like a nightmare to code and maintain for complex scenarios.
Another option is to make a Record Variable: Temporary. By using Temp Tables you can do all CRUD operations without committing anything to your Physical table.
It seems work. I thought your suggestion is the best solution. I could validate field value and not really insert or update the record in physical table. thanks for your answer.