Field Validation

Is it better to use LS for Validation in the Post Save than to use formula language in the Input Validation?

Which one is a better practice to use? I know how to do both but was just curious.

Thanks…

Subject: Field Validation

…probably should not have said field validation…I mean input validation.

Subject: Field Validation

It is personal preference.

I do not use the Input validation event because it runs when the document is being refreshed as well as saved.

You would validate using lotusscript in the QuerySave or onSubmit event which run before the doument is saved not the PostSave event which runs afterwards although you can also use formula language in these events.

Subject: RE: Field Validation

Good point, thanks! :O)

Subject: RE: Field Validation

However, if you wanted to use the Input Validation event, you could code a condition of only checking if the document is being saved:

@If(@IsDocBeingSaved & FieldName = “”;@Failure(“Field Name is a required field”);@Success)

I agree with a large form, LS is better. One thing I do to beef up this thing is to have a computed field on the form called RequiredFields and it can either pull data from a profile document, or you can hardcode a list of fields. Then I use LS to loop thru the items that it finds in this field. If you use a profile document, you can change what is required without the need to access the design. Also, having the computed field allows you to have a different set of required fields in different circumstances.

Just food for thought.

  • Matt

Subject: Field Validation

For one, use lotusscript in the querysave, not the postsave of course.

As for which is better, I do find using querysave more manageable as at least all the code is in one place, you don’t have to trawl through each field to check whether you’ve put the correct validation in. For one large db I’ve got, all the validation is in a script library called from various forms from their querysave.

This also makes it easier for future updates if business processes change (as they do where I am all the time).

Having said that, if it’s a small form with just a couple of editable fields then validation formulas might be easier.

Dan

Subject: RE: Field Validation

Dangit…I meant to say that, QuerySave…sorry. I was using PostSave and had it on my mind~???

Ok, that’s what I wanted to confirm. Seems like with the bigger forms, LS is easier to manage.

Thanks! :O)