New Posts New Posts RSS Feed: Validating lookups
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Validating lookups

 Post Reply Post Reply
Author
antalakas View Drop Down
Newbie
Newbie
Avatar

Joined: 25-Jun-2007
Location: Greece
Posts: 28
Post Options Post Options   Quote antalakas Quote  Post ReplyReply Direct Link To This Post Topic: Validating lookups
    Posted: 04-Mar-2008 at 2:50pm
Let 's say i build a form to handle INSERT/DELETE/UPDATE in a database table.
My table has a relation to a lookup table, and i feel like setting it to mandatory.
I follow mapping rules and implement the form.

I use the UI and insert a new record. The Create method in the object Model for my table
does not set initial value for the lookup.

In this case the lookup fills the gap with a null entity value and the form is working.

When i am trying to save a message is displayed stating that "A foreign key constraint... " etc.
As you remember the lookup was required but not set...

How can i inform my users for the inability to save BEFORE they try to press the save button?


Thank you

Andreas


Back to Top
eileenv View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Jun-2007
Location: United States
Posts: 68
Post Options Post Options   Quote eileenv Quote  Post ReplyReply Direct Link To This Post Posted: 18-Mar-2008 at 1:42pm
One way to accomplish this would be to implement a verifier that checks for foreign key values that are null. Then you can perform instance verification prior to a save and notify users of invalid data before the save occurs.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down