Results 1 to 3 of 3

Thread: Inform user in web / mobile app of why record coudl not be saved

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657

    Inform user in web / mobile app of why record coudl not be saved

    Web app for desktop and mobile in javascript

    When saving a recored I want to call a vfp function via lianja.evaluate to check data before a save and not allow the save if the function returns false.

    I want to use a vfp function, as I already have the code in a prg in my old app, on the database itself or perhaps in meta data so that I don't have to code it in the page itself and have code all over the place

    My question is what is the best way to inform the user that the save could not be done.

    For example adding and animal to my system and part of the data is the animals parents fk. Function would check if the animals birth date is after that of the parent and if the same or before inform the user that "The record could not be saved as animals birth date if before mothers birth date".

    In the web I understand that the UI knows nothing about the backend and vice versa, so what's the best way to display this message in the UI to the user from code on the backend?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,360
    Blog Entries
    22
    Hi David,

    You can perform validation for the page in the "beforeupdate" or "beforecreate" page delegates. Individual fields can have validation and validationerrormessage specified in their attributes which can be inherited from the data dictionary attached to the table that the data bound column belongs to.

    If these return true then the save is disallowed.

    You can use Lianja.showErrorMessage() to inform the user.
    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
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thanks Barry

    Did you mean section rather than page as I can see the beofre update on section but not page attributes?

    I'll take a look at these. If the Page beforeupdate can be set from meta data then that should work for what I want as I can fill it from my Xcase model.

    David
    Last edited by avianmanagement; 2020-10-26 at 08:35.

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