The following code snippet will intercept the save functionality (you can inject your business rules accordingly). It’s important to note that this code must be run in the page’s
Function and Global Variable Declaration section (as part of the page’s properties). A better alternative is to load it via a JS file (hint: use APEX Nitro). It will not work if you try to run it as is in your browser’s console.
Warning: The following code is using undocumented features in the APEX IR JS library. Use at your discretion.
I’ve commented out
return this._super();. Re-enabling it will continue the function (save, remove, etc) as expected. In most cases you would wrap it in an
if condition based on your requirements.
The following demo shows this code in action. Both the save and delete requests don’t complete as the JS code intercepts the requests and logs some information.