Using CheckNumeric to validate the number fields in a WAM
|Date:||25 September 2006|
|Product/Release:||Visual LANSA V11|
|Abstract:||The CheckNumeric option in a WAM can validate the numeric values entered in your WAMS to ensure they match the definition of the fields they are mapping to|
|Submitted By:||LANSA Technical Support|
How to use CheckNumeric:
CheckNumeric is an option that must be enabled for the entire WAM, so the option exists in the WAM definition in Visual LANSA. If you Open the WAM in the editor it will be in the details tab as seen below. It is also possible to add this by adding Checknumeric(YES) to the Begin_Com of the WAM.
It is not necessary to regenerate the XSL after making this change.
How it works
At runtime the value will be checked when you tab out of the field. If the entered value does not match the field definition then a warning message will pop up and the field will be automatically truncated.
If you want to disable the message box but leave the truncating functionality, it is possible to comment out the ALERT statement in function _isValidNumber in Std_Script.js.