Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Best place to write validation

Posted on by 5,901

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

  • Verified answer
    Pradeep_Prakash Profile Picture
    Pradeep_Prakash 715 on at
    RE: Best place to write validation

    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

  • @rp@n Profile Picture
    @rp@n 5,901 on at
    RE: Best place to write validation

    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
    Pradeep_Prakash 715 on at
    RE: Best place to write validation

    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
    @rp@n 5,901 on at
    RE: Best place to write validation

    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

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Best place to write validation

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans