Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 42

Thread: Newbie web app developer: data validation

Hybrid View

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

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Ok, I've create a simple APP, Javascript, based on SouthWind
    I've a section, based on Orders table
    I've created a index on customers table
    Index on customerid tag customerid

    on the customer formfield I've add a validation:
    keylookup('southwind!customers', 'customerid', "'{}'", 'true', 'false')!='false'

    this work on App Builder but not on Web Preview.

    but work on app inspector if I put a value
    keylookup('southwind!customers', 'customerid', "WILMK", 'true', 'false')!='false'

    I've try with single and double quotes

    it's impossible to save the edited records.

  3. #3
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Fabio,

    There are too many quotes around the {}. It should be:

    Code:
    keylookup('southwind!customers', 'customerid', '{}', 'true', 'false')!='false'
    Regards,

    Yvonne

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Can I use:
    Lianja.evaluate("mylib::mylibproc('{}')") ?

  5. #5
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Quote Originally Posted by phabio View Post
    Can I use:
    Lianja.evaluate("mylib::mylibproc('{}')") ?
    Fabio,

    Tell me what you think {} is substituted for. Then maybe you can answer your own question.
    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,893
    Quote Originally Posted by barrymavin View Post
    Fabio,

    Tell me what you think {} is substituted for. Then maybe you can answer your own question.
    Hi Barry,
    this is to use a custom validate code.
    for example:
    you're insert a sales order for cusromer "WILMK"; this code it's right.. but the customer are suspended cause have a not payed invoice..

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Quote Originally Posted by phabio View Post
    Hi Barry,
    this is to use a custom validate code.
    for example:
    you're insert a sales order for cusromer "WILMK"; this code it's right.. but the customer are suspended cause have a not payed invoice..
    Yes I have a good idea what validation is used for.

    What I was trying to explain to you is that Lianja.evaluate() has no clue what {} is.

    When you specify {} in the validation expression for a formitem, the framework knows what formitem is associated with {} and it can then substitute the current input text value.

    {} is primarily used to substitute the current value associated with a UI element. In certain cases e,g Data Mapping on the server it is used to substitute current table.column value.
    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

  8. #8
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Yvonne,
    your sample don't work on web preview.
    Name:  2018-06-12 16_07_46-Window.png
Views: 127
Size:  26.8 KB

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Ok Fabio.

    you need to double the single quotes around the {} as keylookup() is a built-in function that will proxy a call to keylookup on the server.

    You are not enclosing {} in quotes to the server.

    ‘\’{}’\’

    That should properly enclose the value substituted for {} and it will be sent as ‘WILMK’
    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
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Quote Originally Posted by phabio View Post
    Hi Yvonne,
    your sample don't work on web preview.
    Hi Fabio,

    Yes, it does. Put it in the field's validation attribute as you said you were doing in your test App.

    Regards,

    Yvonne

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