0
Requested

Provide ability to 'cancel' a code reference

Maarten Kools 5 years ago in ADAM Core updated 3 years ago 0

It would be great if a Cancel property can be added to the ReferenceData class, providing an ability to 'cancel' the code reference execution.

This can be used to ensure a rule doesn't trigger (or at least doesn't do anything) at certain times (e.g. we might want to temporarily turn off a specific rule, but not others). It can also be used to provide the ability to ignore the request for a reset-to-default (see ticket #6950; we might want to keep the current field value regardless the request to reset it)

customization rules

Hi Maarten,

Could you elaborate on this please, because I'm not sure I understand your request.

A rule can be disabled by unchecking the checkbox 'Enabled', while a default value can be disabled by removing all 'Reset To Default Triggers' and a Validation can be disabled by putting the 'Validation Trigger' to 'None'.

Regards,

Joris

Hi Joris,

It is only possible to disable rules for everybody, and not selectively for just this one condition. What I'd like to see is a possibility to indicate which rules to skip.

For example, I might have a rule that executes on record save. But under certain conditions I might not want this particular rule to execute. As of now I can only set TriggerRules to false in the save options, but this skips all rules. I could also disable the rule, but that disables the rule for everybody.

As a workaround we've created a text field (with StorageMode set to None) to which we add the rule name. So when the rule is executed, we check that field to see if the name is in the comma separated string, and if so, we stop execution of that rule.

 

Now, for rules, this is an easy (albeit a bit nasty) workaround. But for default values the need is greater.

If you have a situation where ADAM triggers the default value reference we might want to keep the current value. However, there's no way to cancel the trigger. So you have to return something, and that something has to be the new value. So it would be nice if the ReferenceData class contains a Cancel property (or something similar) where we could indicate that the return value from the code reference should be ignored.