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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Best place to write validation

(0) ShareShare
ReportReport
Posted on by 56

Dear All,

Can you please let me know if i need to write any validation in form level as per customer requirement then where is best place to write validation. In Table or In Form ?

Please give me more shed on this.

Thanks!

Arpan Sen

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    Use validate* method (such as validate() and validateField()) for validations. Prefer validation methods on tables to methods on the form itself. Which exact method you should use depends on your particular situation; there is no single best place for "any" validation.

  • @rp@n Profile Picture
    56 on at

    Thanks Martin,

    If i write the same validation in AOT > Table > Methods instead of Form > Table > Methods. Is there any any difference?

    Please give me more shed on this.

    Thanks!

    Arpan Sen

  • Verified answer
    Pradeep_Prakash Profile Picture
    717 on at

    Hi Arpen,

    We have 2 reasons for writing code in table level rather on the form.

    1. For code reusability. If you write code in table you no need to write repeated codes in each form for validation.

    2. Performance issues.

  • @rp@n Profile Picture
    56 on at

    Thanks Pradeep,

    So, i think we need to write code in Table level mostly instead of form.

    Point 1 is OK

    Can you please elaborate me Point no 2. How it's impact performance issue?

    Please give me more shed on this.

    Thanks!

    Arpan Sen

  • Verified answer
    Pradeep_Prakash Profile Picture
    717 on at

    Hi Arpen,

    When u write code in form it always run client tier, consuming more resources can reduce the speed of form.  But in table level you can make your code run on server tier.

    For more information please refer

    msdn.microsoft.com/.../aa879485.aspx

    Regards,

    Pradeep

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans