NetTalk Central

Author Topic: Lookup validation  (Read 3183 times)

Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Lookup validation
« on: October 03, 2011, 01:54:27 AM »
Hi,

In an NetWebForm, I have a field with 'Required' checked in the 'Validation' tab and a lookup procedure specified in the 'Lookup Settings' tab along with the lookup table information. Now, if the user enters a value that does not exist in the lookup table, it allows the record to be saved.

How do I ensure that any value entered exists in the lookup table?

Thanks & Regards,
Ubaidullah Nubar.


oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Lookup validation
« Reply #1 on: October 04, 2011, 01:46:26 AM »
 I have exactly the same "problem"....
On validate on this field, Add Server Side code embed
! Servers SIDE
lok:sif_art=format(p_web.gsv('MRS:SIF_ART'),@N06)
ART:SIF_ART = lok:sif_art
ACCESS:ARTIKLI.TRYFETCH(ART:Art)
IF ERRORCODE()
    p_web.ssv('MRS:SIF_ART','')
    p_web.setvalue('SelectField',clip(loc:formname) & '.MRS:SIF_ART') ! on errorcode() user enter any value that not exist in table, or leave it empty...
    p_web.ssv('NotExist',1)
ELSE
    p_web.ssv('MRS:NAZIV_ART',ART:NAZIV)
    p_web.ssv('lok:naziv_artikla',ART:NAZIV)
    p_web.ssv('MRS:SIF_ART',ART:SIF_ART)
    lok:naziv_artikla = art:naziv
    loc:comment = p_web.Translate(lok:naziv_artikla)
END




Ubaidullah

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: Lookup validation
« Reply #2 on: October 04, 2011, 02:28:51 AM »
Thanks. This solved my issue.