web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / what's the differe...
Finance forum

what's the difference between validate field method and modified method in D365FO?

(0) ShareShare
ReportReport
Posted on by 1,552

Hello!

Both methods are called whenever u change a field value. So what's the difference between them and when should i use each one?

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi junior AX,

    They have different purpose. In validate field you should write logic that validates data entered. In modified you update other fields or perform other actions that should happen when field is modified, however, you don't validate data and relay on  validate method. 

  • junior AX Profile Picture
    1,552 on at

    Hi ievgen Miroshnikov,

    what do u mean by the last sentence : you don't validate data and relay on validate method?

    plus do u mean modified method can't be used if i want to do actions on the same field only on other fields?

  • Mea_ Profile Picture
    60,286 on at

    I mean they have their own responsibilities: validate only validates and does not modify anything, modify usually only change related fields but does not do validation, it should be done in validate field method.

    In modify field you can change any data you need, but be aware that you should not update data in the database, because user should be able to revert changes by clicking "Esc" and existing form without saving any changes. And if  you update data in other tables it would be misleading for the user and "unrevertable".

  • Omar Abdelhamed Dev Profile Picture
    105 on at

    ValidateField

    It is executed when we move the cursor from one field to another one. i.e ValidateField () fires every time the user changes the value in a field.

    ValidateWrite

    It is executed before inserting or updating a registry in the table. The validateWrite() method validates that each mandatory field is filled in.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans