Mandatory Data Elements issue in Capture App (versions 105.2.5–105.2.9)

Dear Community,

We are encountering a bug with Mandatory Data Elements in the Capture App (versions 105.2.5–105.2.9). The last version where everything worked correctly was 105.2.4.

In our Tracker Program, within a specific Program Stage, we configured Program Rules (PRs) to hide certain DEs depending on the OrgUnit (OU) and make them mandatory for others.

PR1 expression:

!d2:inOrgUnitGroup(‘uldJOSEYPAz’)
PR1 actions:

  1. Hide DE1
  2. Hide DE2
  3. Hide DE3

PR2 expression:
d2:inOrgUnitGroup(‘uldJOSEYPAz’)


PR2 actions:

  1. Make DE1 mandatory
  2. Make DE2 mandatory
  3. Make DE3 mandatory

In 105.2.4, this worked as expected:

  • PR1 checked whether the OU belonged to the specified OU group.
  • If it did not, the DEs were hidden.
  • PR2 then made those DEs mandatory when applicable.

However, starting from 105.2.5, even when those DEs already have values, the Capture App still displays the error message:
“This field is required.”

Has anyone else experienced this issue with conditionaly mandatory DEs in Capture App (versions 105.2.5–105.2.9)?
Any guidance, workarounds, or confirmation would be greatly appreciated. Thanks in advance for your support!

Hi @m.siusko

Not sure at all if this is related, but I recently faced an issue with a program stage with a validation strategy “On update and insert” where the capture app was acting similarly to what you showed with one of the latest version of Capture Web App on server version 2.41.

I did not have much time to test older versions, but I saw that the problem was not happening after updating the validation strategy to “On complete” through API.

After this change, i was able to edit, save and complete the event.

Do you knwo which validation strategy you used for this program stage?

I did not take time to report this issue, but would be intersted to know if this may be related.

Thanks

Regards

1 Like

Hi @m.siusko,
Thank you for reporting this issue. You can track the progress of the fix in this Jira ticket DHIS2-20777.
Thanks!

2 Likes

Hi! Gregory!
Our validation strategy for this PS is default (ON_COMPLETE)

1 Like

Hi

@gregory @m.siusko

The reported issue DHIS2-20777 - Program rule induced mandatory fields are always invalid has been solved.

You will need to update the Capture app itself from the App Management app to see the changes. Thanks!

2 Likes

Hi @Gassim
I can confirm: the latest Capture APP no logner has this bug.

2 Likes