Hey,
I want to add 2 number Fields together and see if the sum is bigger than 15.
Both “Fehlzeiten…”-fields are number values and the field I’m doing the computation on, is a boolean field.
Does anyone see my thinking error?
There are lots of example for you to look at to better understand Computation Rules. Apart for the Kernel Language Documentation in the Modeling section, there’s also the Kernel Language Tutorial.
In Step 1b of the tutorial we multiple two numbers and then in Step 2b the computation is extended to return different numbers under different circumstances. This is fairly similar to what you are trying to do.
Basically you need to define the Precondition - when the result should be return. In your case this means moving
... And 15 <= [../Fehlzeiten_Ausbildungsstaette] + [../Fehlzeiten_Berufsschule]
to the Precondition.
Calculation - what the result is, is then very simple. For a Boolean Field, the result should be one of the constants True or False. If none of the Preconditions matches, the Field will be cleared.
Yes, you tried to produce a boolean result in the Calculation. You can’t do this in A12, you need to clearly define when the result is True and then add another exclusive precondition when the result is False.
Ahh!
Thank you. Now it works perfectly. ![]()
FYI, you’re not the only one. The Kernel Language just works differently to other programming languages in this respect.