Announcement

Collapse
No announcement yet.

cancel/stop record save based on condition

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

  • cancel/stop record save based on condition

    Hi,
    Can anyone please help me as to how I can stop the record from being saved either from front end js or php. I am looking for a functionality similar to 'Record not modified'.

    Description:
    My code for api is triggered in 'before:save' condition of record and returns a ID back to CRM. I am checking if the ID is valid and cancel save if it is not valid.
    I have tried triggering the 'cancel:save' event, tried this.ischanged = false, throw an error from js(this stops the execution but not the desired result as mentioned earlier), throw an exception from php.

    Thanks in advance for any help on this.




  • #2
    I was able to solve this. wrote a custom method for actionSave to complete my validation then called Dep.prototype.actionSave.call(this).

    Comment


    • #3
      Could you please post the code you wrote? I need to do something similar, but I'm not very good at JS.

      Comment

      Working...
      X