current.setAbortAction(true) causes the error message 'Invalid update'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2013 08:26 AM
Guys,
I got stuck with current.setAbortAction(true) in a business rule... I have a simple business rule on an incident table:
When:
Before
Update:
yes
Condition:
current.category=='Software'&& !current.hasAttachments()
Script:
gs.addInfoMessage("No attached documents found! Operation cancelled.") current.setAbortAction(true);
But this rule causes and error message 'Invalid update' when I try to save an incident without attachments and with Category='Software'. My custom info message will be displayed as well, but why 'Invalid update' is there???
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2013 08:39 AM
What about doing an 'OnSubmit' Client Script, with an AJAX or function call to verify an attachment exists? If no Attachment display a message and abort Submit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2013 08:50 AM
Yes, if we are talking about attachments then there is a very nice solution for that (onSubmit client script):
function onSubmit() {
var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) {
alert('You must attach at least 1 file.');
return false;
}
return true;
}
...but if we are talking about how to get rid of 'Invalid update' message caused by a business rule, there is no good solution for that. Just don't use abort function in a business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2017 05:11 AM
HI Everyone,
Please let me know is there any way to suppress "Invalid Update" in business rule itself.
Could any one can help me with this.
Thanks,
Alekhya N
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2017 01:44 AM
Hi Andrew,
I think for this table you have written few more business rules that might be before or after "insert/update". While inserting this new record one of your business rule is not letting them to insert/update a record and may be another business rules are executing. (This is the only reason you are getting "Invalid Insert/ Invalid Update" error message because you have used setAbortAction(true) somewhere)
So my best suggestion to you, You can give execution order for created business rule otherwise you can write one client script onSubmit() and return false if you don't want to insert new record on certain condition.
Note: Write a client script, Client script is not recommended for best practice as well.
Thanks,
Jeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 04:49 AM
a semicolon is what is missing !