Business Rule only runs when checkbox is checked but it should always run?

mike275
Mega Expert

I have a simple business rule that adds 2 error values to my and aborts a save.  It's a simple script:

(function executeRule(current, previous /*null when async*/) {
	current.setAbortAction(true);
	var gdt = new GlideDateTime(current.ap_end_of_support_date.toString() + ' 00:00:00');
	gdt.addDaysLocalTime(365);
	current.ap_end_of_support_date.setError("Error: " + current.ap_end_of_support_date + ' ' + gdt);
	
	current.setAbortAction(true);
	current.wpa2_psk_using_aes.setError('Encryption is required');
	
})(current, previous);

Here's the rule:

find_real_file.png

 

Now, when I run it on the form it works fine.  If I check the AES true/false checkbox, it stops running the rule.  The rule should always run and should always prevent the form submission.  Why is it only running based on the checkbox state?  This does not make sense.

This is the only business rule defined on the table, which is a custom table inheriting from nothing in a scoped app.  The app has only 1 table.  Here is an animation of how it is (not) working:

find_real_file.png

5 REPLIES 5

dvp
Mega Sage
Mega Sage

Check if you a business rule that is stopping from other rules to run.

Search in business rule script if you have setWorkflow(false)