NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Poul Jensen on January 23, 2024, 11:48:56 AM

Title: NT WebForm: Check entered value before lookup validation
Post by: Poul Jensen on January 23, 2024, 11:48:56 AM
A field has a lookup button that validates the entry or the picked lookup value.

But I would like to run some code and validate the entered value before the lookup button does it's validation.

What embed could I use for this - there are SO MANY so I am a bit lost here :-)

tia
/Poul
Title: Re: NT WebForm: Check entered value before lookup validation
Post by: Bruce on January 23, 2024, 10:40:29 PM
You'll have to explain more, or post an example.
I'm not sure what you mean by "a lookup button that validates the entry".
buttons don't validate things, so I feel either I don't understand what you are doing, or you're describing it wrong.
Title: Re: NT WebForm: Check entered value before lookup validation
Post by: Poul Jensen on January 24, 2024, 12:01:55 AM
Hi Bruce,

A simple form where the first field (item no) is validated against the stock table using item number.
But the stock table also has a barcode field, and users need to be able to enter either barcode or item no. in the field.
The code I want to run then looks up first item no, if that fails looks up barcode.  If that is found the entered valued is changed to the item no of the found stock item.

So I need to run this code before the standard validation kicks in.

Does that makes sence?

/Poul

Title: Re: NT WebForm: Check entered value before lookup validation
Post by: Bruce on January 24, 2024, 02:32:18 AM
Validation happens in the
ValidateValue::Whatever
routine
Title: Re: NT WebForm: Check entered value before lookup validation
Post by: Poul Jensen on January 24, 2024, 05:07:47 AM
Thanks Bruce,

I had tried:
- Validate::MSagL:VARENR Routine
- ValidateValue::MSagL:VARENR  Routine
- ValidateInsert  Routine

but I should have used:
- ValidateRecord  Routine

sigh......

/Poul