ValidateField trigger getting invoked multiple times

Hi all, 

I am trying to make an external web service call for a field value to validate it. Currently there are some standard validations on the field in D365 which are called from validateField method. Hence I am writing a COC on the validateField method. However this method is getting invoked when I am closing the form as well, I want to to be invoked only when the field is modified or created. However I can not write on modified since validateField trigger takes place before modified and I want external validation to take place first. I am writing the methods currently at the COC of table since this field is present at multiple locations and writing at the form level is not an option. Any help would be much appreciated. Thanks

Parents
No Data
Reply
  • It sounds like you've modified a field and you're closing the form, which means that you're leaving the field and therefore the value gets validated and then the whole record is validation and saved to database. Isn't it the case?

    If not, use the debugger to find out what is calling the method.

    Also, don't forget that the method is called for any field, not just the one field you're interested.

    And you're wrong in thinking that your only options are validations on table and validations on form controls. You forgot validations on data source fields.

Children
No Data
Related
Recommended