Does having a field go to read only stop calculations from firing?

302
3
07-27-2020 01:49 PM
DougBrowning
MVP Esteemed Contributor

I have a weird one.  

I have a calc field to add preselected values in for the users.

If you select Fines then it populates a 1 and goes read only.  ( so that someone cannot have Fines and a 10 or something)

If you fill out some fields then go forward 2 repeats (just one advance will not do it), then move back all the calcs stop working.

So now when I click Sand I should see it change to 2 but it does not.

So users cannot go backwards at all and change the data.

If I uncheck all then hit the recalc button then click sand it will come back to life.

Any idea what is going on here?  My guess is that once it goes read only then the calcs stop.  Not ideal.

Any ideas?

field type is Decimal
calc is if(${NonParticleSize15}='Fines',1,if(${NonParticleSize15}='Sand',2,if(${NonParticleSize15}='Hardpan',4098,if(${NonParticleSize15}='Bedrock',4097,''))))

read only is   ${NonParticleSize15}!=''

thanks

0 Kudos
3 Replies
by Anonymous User
Not applicable

Hi Doug,

Yes, what you are seeing is expected. When a field/question is read only, calculations are not automatically updated, and this is to avoid unintended data value changes. The point of a field/question being read only is that the value can not be changed, either by user input or calculation to maintain its read-only property.

Regards,

Phil.

DougBrowning
MVP Esteemed Contributor

Thanks Phil.  It works slick for the most part so that is a bummer, but makes sense.  But on testing I am not sure this is it.

It works fine at first though.  It only stops reacting if I advance the repeat then go back.  If I stay in the repeat it all works and the values will change just fine.  But I think you are saying it should not?  What is different after the repeat advance?

In the past I think I added a dummy if to a calc to make it fire again.  Open to ideas.

Thanks

0 Kudos
by Anonymous User
Not applicable

Hi Doug,

Yes this is expected, if you are on a new/same record and changing values as still part of the original input, and it has not yet been saved/navigated away from, then a change to the calculations are applied as user may still adjusted that record. But once you move away from the record or save it, the read only attribute will apply and not allow further edits.

Regards,

Phil.

0 Kudos