Grey Field in Custom Forms - Not Greyed (disabled) in New Data Entry (Beta) but ok with old data entry app

Hi,

We are trying to grey out some fields, in a custom form for a dataSet.

When i use the option, in the custom foirm editor, to add a grey field (Insert Grey disabled field)

If iI open the form with the old data entry, the field is disabled for data entry as expected, but when using the new dataentry app, the field is not disabled.

Is it expected behavior that the new app does not support this feature anymore?

This can be reproduced on play (2.41.4) with the program “Clinical Monotirng checlklist” by adding any field as greyed (done today with the field CMC-Stock out other), and then opening the data entry (beta) app:
Data Entry | DHIS2

If you open the same dataset with the legacy data entry app, the field is disabled a expected.

Thanks in advance

Hi all,

After additional testing, it appears that the readonly attribute is only kept in the custom forms when adding a grey input field for the types “Indicators”, and “Total” (for diaggregated DE), but not when adding a DE as a grey field (filled in by a predictor for instance) in the custom form.

I tried to manualy edit the HTML source code, and saw that the attribute “disabled” is present in the HTML source for all types (Indicators, DE and total) but the readonly attribute is only present for “Indicators” and “totals”. If I edit the source code, add the readonly attribute for a DE and save, the readonly is automatically removed from the HTML source code.

Hi @gregory,

Yes, you can manage grey fields in the new Data Entry app; however, there’s a different way to configure that, please see the video (URL is at the time of the slide: ‘Manage grey field’): https://youtu.be/2Uln3_UZ5ns?t=942

In addition to the video webinar linked above, please go through Retirement of the old Data Entry App and the Tracker Capture app in V42 to learn about transitioning to the new Data Entry app.

Thanks!

Dear @Gassim,

Thanks a lot forreplying, even during the DAC2025 week :-).

However, the video you shared only show how to grey field in section forms, but not in custom forms.

In the PPTX presentation, it seems like there is a way to “disable” some DataElements (eveni with disaggregation", but as mentioned above, this seems not to work for disaggregated data elements.

Technically, the grey field seem to use HTML Attributes (disabled=“disabled” or read-only=“readonly” for input fields) when editing the source code in Maintenance app, but it seems that when saving the HTML source code, the “read only” or disabled atttributes are not kept/transormed.

Is there a way to inject HTML codes in custom forms without going through the “source code” mode in maintenance app?

May be directly through the API? Is that the supposed way to make grey fields for dataElements with disaggregation in custom Forms?

Thanks in advance

Hi again,

I tried to add the readonly=“readonly” directly in a “dataentryForms” json payload, and send to the server through import/export (e.g. I tried to by-pass the HTML source code editor from maintenance app).

Unfortunately this did not work neither :frowning:

Any idea if there are no ways to disable disaggregated data elements in custom form for new Web data Entry (Beta) App?

Thanks in advance

Hi again,

Nobody uses grey fields in custom forms with the new data-entry App?

Thanks in advance

Hi Gregory,
This appears to be a bug, I’ve created a ticket in Jira to address this and you can follow here Jira.
Thanks for bringing this to our attention.

Hi @DavidCKen

Many thanks for the confirmtion.

As the Data entry app is on continuous release, do you think we can consider that this should be solved in the following weeks? As we have a eployment planned, we need to consider wether we can use the new data entry app or the old data entry app for this one.

Thanks a lot.