Announcement

Collapse
No announcement yet.

api before-save question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • api before-save question

    Hi,
    I would like to use the before-save API to enable the unit to be saved only after accepting the regulations. The regulations are a boolen field.

    I used the following function, but the unit can be saved even if you do not accept the regulations:
    HTML Code:
    if (regulations == 'false') {
        recordService\throwBadRequest("Accept the regulations before saving");
    }

  • #2
    you use not use the quote, it should be like below:

    PHP Code:
    if (regulations == false) {
    recordService\throwBadRequest("Accept the regulations before saving");
    }
    ​ 
    Rabii
    Web Dev

    Comment


    • #3
      Originally posted by rabii View Post
      you use not use the quote, it should be like below:

      PHP Code:
      if (regulations == false) {
      recordService\throwBadRequest("Accept the regulations before saving");
      }
      ​ 
      Thank you rabil

      Comment

      Working...
      X