I am trying to improve user functionality on a UD child table.
The three columns are weights: Grams, Oz, and Lbs.
A user could enter a value in any one of the three columns, then when tabbing off that column, the other two columns should populate (with the calculated converted values).
If the user enters 1 in the Lbs column, I would like to automatically populate the Grams column with 454 and populate the Oz column with 16.
If the user enters 908 in the Grams column, I would like to automatically populate 32 in the Oz column and 2 in the Lbs column.
If the user enters 24 in the Oz column, I would like to automatically populate 681 in the Grams column and 1.5 in the Lbs column.
Is this possible or is this too difficult to be accomplished?
Would you want it to update on the form immediately when they enter a value, or update when they save the record? The former would require a form customization and a Field Changed event. The latter would require an In-Transaction Data Directive BPM.
In either case, you would need 3 cases – one for each field changing. If you use the form customization, you would need to make sure updating one of the calculated fields doesn’t cause the update to run again and again and again.
There should be an OnLeave, or Lost Focus function you could tie to.
One thing that might mess you up, is if the rounding you do isn’t 100% backward compatible. Lbs to Grams to OZ is fairly okay as there aren’t much rounding issues.
But if you did this with IN, FT, and cm, 1 foot = 12 in = 30.48 cm. Not to bad …
But starting with entering 8 inches, 8 in = 0.66666667 FT = 20.32 cm.
If you round FT to 2 decimals, it would go in as 0.67 FT which converts to 8.04 IN and 20.42 cm.
Maybe that’s not an issue for the actual value, but it would look weird if a report said that 8.04 IN were required instead of an even 8.