FDA: Check All Controls For Errors ?

brandonkirsch

Active Member
Hi everyone,
I'm a bit new to FDA development. I've made a fairly complex form with a dozen or so "Control Errors" that get thrown when a validation routine fails.

I have a custom "Push Button" on the screen that finalizes the transaction, but first I want to check to see if any errors are present on the form.

I'm wondering if there is a System Function call or something similar that I can use to check. Just a simple True/False would work.

Otherwise, it can get tedious to check each and every individual control for error before I proceed with the "finalize" routine.

I've checked the manual for FDA 8.98.4 and I'm just not finding it.

Any advice is appreciated, thanks!

-Brandon
 
Hi Brandon,

JDE will validate all your fields for you anyway. When OK is clicked ALL FCs are run through one by one
* Perform Event Rules: Control is Exited
* Perform Event Rules: Control is Exited and Changed  Inline
* Perform Event Rules: Control is Exited and Changed  Async
* Perform Data Dictionary validation

So you can either place you error checks in the OK button clicked or in the actual FC controls itself. The girs you need to add code into Grid Row is Exited Asynch or Inline
(Inline fires first)


Click your custom button in OK Button Clicked to do extra checks if you want.

If there are ANY error, OK button ends and will not hit the Post button clicked

And then in Post Button Clicked, you do the good stuff to the database.

If there are errors, Post Button Clicked never actually runs

Hope that helps?

What form is it as I can upload the event sequence for you
 
Hi John,
Thanks for the excellent advice. Here's what I did:

My custom Push Button Clicked event sets Errors & Warnings, then presses the "OK" button. That leverages all of the built in form validation. Errors stop processing, Warnings can be bypassed by clicking my Push Button a second time. Perfect!

But then another problem: Because I execute the "OK Button Clicked" event, my Headerless Detail form wanted to quit.

That's when I ran into this link (thanks, Zoltan!) http://www.jdelist.com/ubb/showflat.php?Cat&Number=122243&Main=122182

So here's what I did to accomplish "normal" form validation, but also prevent my app from closing on success:

1) My Custom Push Button sets Errors & Warnings, then executes Push Button(OK)
2) OK - Button Clicked event won't fire if Errors or 1st Time Warnings are present. So the only line of code there is to click a hidden button that has all the work.
3) My hidden button Clicked event does all the DB work. The last line of code throws a bogus control error. This is key, the bogus control error stops the OK Post Button Clicked from closing my app.
4) Finally, event processing returns to my custom Push Button Clicked event (which just pressed the OK button) and the bogus control error is cleared.

The end result is normal form validation. The bogus error is never displayed to the user. And the app continues to run.

Thanks so much, I'm so happy to *not* have to code "Warning" acknowledgments by hand
cool.gif
 
Back
Top