Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42

Thread: Newbie web app developer: data validation

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881

    Newbie web app developer: data validation

    Hi all,
    linked to this post https://www.lianja.com/community/sho...st-data-access, I'm tryng to create some test app for my new ERP.

    My first question is:
    I can use function like (keylookup('pdc', 'conto', '{}', true, false)) on FormItem data validation?
    I think no.. this is Lianja/VFP..

    But I can use this code on column data validation into the DB.. right?

    thanks
    Fabio

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,776
    Hi Fabio,

    Right click on the browser window and inspect it.

    Select the console.

    Type expressions and look at the results.

    keyLookup() is there as is sqlLookup().

    Javascript is case sensitive.

    Any expressions that cannot be evaluated on the client are evaluated on the server. So you can call your own functions on the server.

    https://www.lianja.com/doc/index.php/Data_Validation
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    Thanks Barry.

    this work!

    keylookup("semdata!pdc", "conto", "20/01/EMMB", "true", "false")!="false"

    Fabio

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    work on the Inspector, but not work as a data validation.

    On the FormItem, I've wryte:
    keylookup("semdata!pdc", "conto", "{}", "true", "false")!="false"

    but on the preview, the record are not updated... without error.

    thanks
    Fabio

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,776
    Try single quotes and learn how to see what network requests are made to see any possible errors.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #6
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    I don't know where to search any error..

    on the inspector:
    keylookup('semdata!caucont', 'C_CAUCONT', 'IFAC', 'true', 'false')!='false'
    return true..

    keylookup('semdata!caucont', 'C_CAUCONT', 'XXXXXXXX', 'true', 'false')!='false'
    return true.. but it's wrong..

    I'm confused (and ignorant).

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    Ok, on the debug window, I see something
    Name:  2018-06-12 14_03_00-Window.png
Views: 57
Size:  18.6 KB

    but why the string are without quotes?

  8. #8
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    found.. I need to wryte:
    keylookup('semdata!caucont', 'C_CAUCONT', "'{}'", 'true', 'false')!='false'

    but this work on the inspector, don't work on the Lianha App Builder and don't work on the Lianja Web App View

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,776
    You still have it in double quotes.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,881
    I've try with single and double..

Page 1 of 5 123 ... LastLast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us