Iam using DHIS 2 version 2.33.3
I have a data element: total sessions attended, value type: positive or zero integer. The same data element is in 5 program stages. I have created a program rule to prevent users from entering a number greater than 6 for this data element, but it does not seem to be working because one of the users has entered by mistake 16120946 and has managed to save the value. I have also tried it in the DHIS 2 demo and it is not working. Maybe something is wrong with the PR.
When entering a value greater than 6, the error is shown. but if you click on complete, the value is saved.
e.g. Below is the data I entered and exported
HI @hernandezmachava makes sense. However when i go into the tracker capture and select that I would like to edit the data, it doesn’t let me call the data complete until I fix the error:
I don’t think this will work retroactively, but presumably would prevent you from entering in data >6 in the future.
Hello @hernandezmachava
In your case try to choose the Program stage name in “Trigger rule only for program stage”, in order to check that rules inside that particular stage.
When you create “Define program rule actions”, try to choose a field name in “Tracked entity attribute to display error next to”. It will prevent the user to pass to the next field if you have an error and also will clear the entered value.
Additionally I can suggest just to add &verbose in the end of your request string in address bar, and open Console, so you can see which rules are working and what was the result of the program rules.