Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

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

(0) ShareShare
ReportReport
Posted on by 113

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. 

  • JohnBright Profile Picture
    JohnBright 113 on at
    RE: How to write custom validations on standard edit methods on a form

    Hi Judy,thanks for your response. 

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

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: How to write custom validations on standard edit methods on a form

    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?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans