Override OnValidate trigger on table field

weneedweneed Member Posts: 82
There I a way to skip onvalidate trigger in table filed?

Answers

  • JuhlJuhl Member Posts: 724
    From code yes, from page no
    Follow me on my blog juhl.blog
  • weneedweneed Member Posts: 82
    I mean without modifying the Microsoft code but using an extension. How?
  • TallyHoTallyHo Member Posts: 415
    Like Juhl said, just don't validate the field in your extension code, assign it.
    If using a page for input, try to do the same by indirectly assigning it.
  • DenSterDenSter Member Posts: 8,307
    You can set a field value without validating it, which simply doesn't execute the OnValidate code. You can subscribe to OnBefore and OnAfter, and you can add code to OnValidate triggers in table extensions. Some OnValidate triggers raise event publishers that you can subscribe to in your extension.

    What you cannot do is disable the OnValidate code in an extension. If BC (whether it's the base app or your extension) causes a field validation, it will always run the code in the OnValidate trigger.
  • weneedweneed Member Posts: 82
    edited 2020-05-01
    So solution is to expose another field in a page and assign value to original field through code without validation.
  • TallyHoTallyHo Member Posts: 415
    edited 2020-05-01
    Correct, or expose a global variable, that should do the job in a card page.
  • RockWithNAVRockWithNAV Member Posts: 1,139
    That was a solution how to disable On Validate trigger but another important question and decision is - Do you really disable it and if it standard NAV field?
Sign In or Register to comment.