Best place to put validations?

Best place to put validations?

Post by Brad Herd » Thu, 08 Feb 1996 04:00:00

Kind of a newbie question here...

Can anyone give me an opinion on where validations should be put?

I am having a "discussion" with a co-worker about this who insists they should
all be done in a window function and that we shouldn't use the
Rows-->Column Specifications... even for simple validations.

Additionally, he wants to put a call to AcceptText() in the losefocus event,
which wrecks using validations in Row-->Column Specifications since they get
triggered all the time (even when you hit the cancel button to close the window
without saving data - so you have to fix your data before you can exit).

My personal opinion is that the losefocus event shouldn't have any code in it.
The ue_presave event should look something like this:

if ( AcceptText() = 1 ) then

   if ( iou_column_state.ibassertnotnullforrequired() ) then // check non-visual
                                                             // user object to see if
      PostEvent ( this, "ue_save" )                          // all req'd fields are
                                                             // filled in.
   end if

end if

and ue_save should look like this:

SetPointer ( HourGlass! )
iw_frame.SetMicroHelp ( "Updating data..." )

if ( wf_update_dw() ) then
   iw_frame.SetMicroHelp ( "Data updated successfully." )
   iw_frame.SetMicroHelp ( "Data not updated." )
end if

My friend has AcceptText() calls in all the events: losefocus(), ue_presave() and
ue_save()... so when I have an error - I get three popups telling me about it,
whereas (of course - he isn't checking the return code from any of them)....

So - please tell me your strategy for handling validations!!!

Thanks very much,
Brad Herder


1. best place to put fixed costs?

In P2000 I can put fixed costs in the cost table, or list them in the
resource sheet as a material + cost per use.

If I put it in the cost cell (cost table):

    It is Prorated
    I can see separate from, but included in Total Cost for task (in cost

If I put it in the resource sheet as a material (with cost per use):

     I can see it listed along with its $ value
     It is included in Total Cost for task (in cost table)

I am not a project manager, and have no experience with costing.  Please
explain the best way to go, or is it a toss up?

many thanks

2. Cachefs

3. FS2002 : They've put the London Dome in the wrong place!!!

4. MS interview

5. Visio c# code generation puts "using" in wrong place.

6. Zoom V.34's any good?


8. Calligraph Laser

9. Best place to buy?

10. Nikon 4000 ED best place to purchase

11. Best place to buy a Nikon Coolscan 4000 or Canon FS-4000?

12. Acer Scanwit 2720 - best place to buy?