OnValidate trigger form/table behavior

ben5000ben5000 Member Posts: 110
Hi all,

I've some code in the OnValidate trigger of a form which is not executed when I'm using the form to input data.
I suspect this is because the OnValidate trigger on Table level contains some code too.

Can you confirm this behavior? Is there a way to execute the code in the OnValidate trigger (on the form) after the code of the table is executed?

I would like to avoid copying the code of the form in the table because it displays some error messages...

Thanks a lot :)

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    As per me, first the Table onValidate trigger will be executed and then Form OnValidate trigger..

    Just try by putting some messages in table and form onvalidate and try
  • ben5000ben5000 Member Posts: 110
    After this test it seems that only the table trigger is executed :(
    Maybe a property can change this behavior?
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I have not set any property..
    Just added a field in Purchase Header Table and displayed on Form..
    added messages in table field Onvalidate and Form field Onvalidate..
    First got table message and then form..

    comment the existing code and try..
    Can you show us the code on Onvalidate triggers of table and form?
  • ben5000ben5000 Member Posts: 110
    I'm running Nav 5.00 maybe it's the reason? Are you using Nav 2009?
  • ben5000ben5000 Member Posts: 110
    Issue solved: there was some code in the OnLookup trigger which caused the field to be implicitly not validated.
  • AndwianAndwian Member Posts: 627
    ben5000 wrote:
    I'm running Nav 5.00 maybe it's the reason?
    I don't think so.
    ben5000 wrote:
    I would like to avoid copying the code of the form in the table because it displays some error messages...
    Back to the basic, what error you get? And what do you want to achieve? This simple general question maybe so basic, and hopefully could lead you to the real solution. :wink:
    Regards,
    Andwian
  • DenSterDenSter Member Posts: 8,307
    All validation code should be on a table level. You should NEVER have ANY data validation code on the form.

    Don't "copy" the code to the table, "move" the code to the table. Use CurrFieldNo to determine whether the validation happens on a form. Use GUIALLOWED for default behavior in NAS.
  • ben5000ben5000 Member Posts: 110
    Many thanks four your answers:)
  • ChowdaryChowdary Member Posts: 148
    I have same problem

    on Service Order Assigned UserID OnValidate() I have some code. I need this code to effect when the value is changing from integrated application. This code is effecting only with manual interaction. I hope that is clear, please help

    Thank You
    Pleasure in the job puts perfection in the work
Sign In or Register to comment.