Hi @IsmaelChivite or anyone else,
The parameter calculationMode=whenEmpty has stopped working for me. It's been working for almost a year. After a process of elimination, I found that if I turn off "readonly" or "hidden" it works, but if I turn off "readonly" or "hidden" it gives the submitter the ability to recalculate the field which I do not want to happen. Why is this happening, is this a new bug or expected behavior after one of the updates? Is there a work around to fix this?
Kind regards,
Jerry
Hey Jerry,
I've been running into this same issue. Any luck?
Thanks,
Jon
Hi @JonCardiello ,
For me it first happened on a date field. I figured out that if I wrap my calculation in "once()" that it behaves the same as "calculationMode=whenEmpty". If you want it to be read only create a note field to display your calculation. Make sure you set the "body::esri:visible" field to "no" to hide your original field with the calculation. Below is an example from one of my projects. I now use this method for any field that I want to use "calculationMode=whenEmpty".
type | name | label | hint | guidance_hint | appearance | required | required_message | readonly | default | calculation | constraint | constraint_message | relevant | choice_filter | repeat_count | media::audio | media::image | bind::type | bind::esri:fieldType | bind::esri:fieldLength | bind::esri:fieldAlias | body::esri:style | bind::esri:parameters | parameters | body::accept | body::esri:visible |
date | Date_of_Request | Date of Request: | once(today()) | esriFieldTypeDate | calculationMode=whenEmpty | no | ||||||||||||||||||||
note | <b>Date of Request:</b> | format-date(${Date_of_Request},'%m/%d/%Y') | regex(${Location_Status}, "P01|B1|T5") |
Kind regards,
Jerry