NetTalk Central

Author Topic: NT WebForm: Check entered value before lookup validation  (Read 668 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • Email
NT WebForm: Check entered value before lookup validation
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: NT WebForm: Check entered value before lookup validation
« Reply #1 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.

Poul Jensen

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • Email
Re: NT WebForm: Check entered value before lookup validation
« Reply #2 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


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: NT WebForm: Check entered value before lookup validation
« Reply #3 on: January 24, 2024, 02:32:18 AM »
Validation happens in the
ValidateValue::Whatever
routine

Poul Jensen

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • Email
Re: NT WebForm: Check entered value before lookup validation
« Reply #4 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