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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to write custom validations on standard edit methods on a form

(0) ShareShare
ReportReport
Posted on by 115

Hi all! 

I have an requirement to write validations on modifying an edit method field in the "All favorites" form under PMA --> Setup --> Timesheets. 

This edit method validates the activity number given by the user and populates the data into the Activity number field of the data source of the form. 

My requirement is to perform a validation on modifying the edit method field. The validation works for the activity number if we create a record with legal entity as current company. But I was not able to do validation if I select a different legal entity(Eg.USRT)  for the record under the current company(USMF). 

Things that I tried so far and didn't work: 

  1) Taking COC for validate field of the table and called the validate field under on modifying event of the form string control. On this occasion the standard error for table relation strikes as the system checks the value of selected activity number of a different legal entity with the Activities table of the current legal entity. 

  2) On validating and On validated write events of the string control (As the string control does not have the selected string value when being hit)

Appreciate any inputs on it. 

I have the same question (0)
  • Verified answer
    huijij Profile Picture
    19,811 on at

    Hi JohnBright,

    The data input by the user is usually best validated in the validateWrite() method of the table or Data Source. But the validating can also be added to an edit method. Did you try this way?

  • JohnBright Profile Picture
    115 on at

    Hi Judy,thanks for your response. 

    Yeah I took COC for the edit method and it worked. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans