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

Thread: Newbie web app developer: data validation

  1. #11
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    It’s to do with how you are quoting the arguments. I’ll look at it tomorrow. You can quote ‘ by specifying it twice e.g ‘’.
    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

  2. #12
    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. #13
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Can I use:
    Lianja.evaluate("mylib::mylibproc('{}')") ?

  4. #14
    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

  5. #15
    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

  6. #16
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    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

  7. #17
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    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

  8. #18
    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..

  9. #19
    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

  10. #20
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    i've updated the Validate:
    Lianja.evaluate("mylib::mylibproc('\'{}'\')")

    but I got the error:
    mar giu 12 16:24:40 2018
    **** Lianja error ****
    mylibproc('\'WILML'\')
    ^
    ')' was expected

    mar giu 12 16:24:40 2018
    **** Lianja error ****
    Lianja.evaluate("mylib::mylibproc('\'WILML'\')")
    ^
    METHOD 'EVALUATE' not found

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