How to display a warning message and stopping the user from submitting the form based on a calculation field

I have 2 scenarios that I need to cater for.

  1. Cannot proceed (Cannot submit the form) - this is a calculation that stops the user from submitting th form; behaves like a required field maybe. An example the number of people found to have a positive HIV test cannot be greater than the total of number of patients tested.

  2. Warning (Shows a message so that the user is aware but can still submit) - this is a situation where the counts are made into a proportion and compared with a percent. If the proportion is greater than or less than a threshold, it’s suspiciously incorrect, but the data entry person can still proceed and submit.

Hi Calvin,

Here are some options :

  1. Add a madatory Multiple choice question without choices, and set it's display condition to match your requirement. the user won't be able to proceed unless the display condition is lifted.

  2. Add a label with a display condition matching the threshold. you can then format the label using those options : https://wiki.commcarehq.org/display/commcarepublic/Advanced+CommCare+Android+Formatting#AdvancedCommCareAndroidFormatting-NotificationLabel

-Michel

Thank you so much for the response Michel. This was greatly helpful!
I also found for 1 that you can use a label to the same effect, which is what I ended up doing.

For 2 I was not aware about the color options that you can set for a label making it a notification label! This perfect! Thank you so much for your insight!