You are viewing limited content. For full access, please sign in.

Question

Question

Forms - Number field - Minimum is ignored if calculation is performed

asked on December 29, 2022 Show version history

Hello,

I have a field on a form that I'd like to limit to a range of 0 to 500. However, this field is read-only, and is populated by a calculation involving two other fields. The range does not seem to apply because of this. Is there a way to get the range to still work?

This field calculates the miles driven based on the beginning miles and ending miles provided. I'd put a limit on those two fields, but with multiple vehicles in the customer's fleet, we don't know what we can realistically limit those fields to in order to make sure we don't have a user include an extra digit and suddenly cause the ending miles to be 1500000 instead of 150000. This is important to them as they track miles driven to schedule service. So if the Total Miles field could have a limit placed on it - they don't think they'll ever have someone drive 500 miles in a day - that would get us what we want. This form currently uses the classic designer.

Any help is appreciated. Thanks!

0 0

Replies

replied on December 29, 2022

An example form design would be as follows:

Use four number fields for "beginning miles", "ending miles", "miles driven", and "maximum ending miles". Make "miles driven" and "maximum ending miles" read only. Optionally, hide "maximum ending miles".

Use a calculation for "maximum ending miles" where it =beginning_miles+500.

Use a calculation for "miles driven" where it =ending_miles-beginning_miles.

Use a field rule where it validates "ending miles" as a field value between "beginning miles" and "maximum ending miles" always.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.