Validating values in a numeric field

I am trying to validate a numeric field on exit of the field. When a user enters alpha-text, notes gives the ‘Variant does not contain a container’ error. Using the debugger to view the field it appears that it’s blank. I’ve tried using IsNumeric, but it’s bombing out when trying to evaluate the function.Thanks in Advance-

Chris

Subject: Validating values in a numeric field

I think you’ll need to post your code.

Subject: RE: Validating values in a numeric field

Use NotesUIDocument.FieldGetText to get the text from the field. The NotesDocument contains Notes’ attempt to translate the data to the specified type of the field, which in this case can’t be done. I expect it’s an error value, which is not an array. Therefore, your attempt to refer to doc.fieldname(0) is complaining that there is no such thing because doc.fieldname is not an array (a.k.a. “container”). So actually, you could detect an error by using IsArray(doc.fieldname).

Now that I’ve answered your question, I’d like to take a moment to urge you to not validate fields on field exit. That’s very annoying to users.

Subject: RE: Validating values in a numeric field

Actually I found a better method. I used Notesitem type codes to determine what the field contents were. Also, isn’t every field on a lotus form treated as an array by default?? Well - no biggie it works now.

Anyway, as far as being annoying to users - they are the ones that asked for it. The system errors like ‘Variant does not…’ are annoying to them, so I have to create user-friendly error messages for them.

Subject: RE: Validating values in a numeric field

good afternoon Chris,

we are also trying to validate a numeric field to get a userfriendly error msg. could you please send us the code that you are using to validate this field ??? we are failing by using NotesItem.

thanx Thomas

(twende@de.ibm.com)