
Formula for On Click field to change the value manually by typing that is display from a reference table.
Hi, I have a form which show me fields with values from different tables like for expample the carton measurements Length, Width and Height. However, sometimes it happen that the measurements differs and needed to be updated for the specific shipment. How can I create a formula, that when I click on the field that I can change the size of the carton manually by typing in but without changing the values from the referenced table. Thanks.
-
Another approach using a Choice field with "Trigger after upate" set to:
if text(Choice) = "Edit" then
Height := null;
Width := null;
Length := null
else
let c := text(Choice);
let t := (select Cartons where Description = c);
Height := first(t.Height);
Width := first(t.Width);
Length := first(t.Length)
end
-
Just to add some diversity...
Since the "Carton" table is linked, I suppose that you have, in the "Shipments" table, a n:1 reference field called, by default, "Carton". In its "Trigger after update" optional configuration field, you could put:
Height := Carton.Height;
Width := Carton.Width;
Length := Carton.Length
This way, after selecting a linked carton record, the numeric fields in the shipment depicting the dimensions are initialised, and you can then modify them if needed. If you feel that it could sometimes be necessary to reinitialise them to the defaults for the chosen carton, define a button with the same script.
-
Since the Length, Width and Heigth fields must be Number fields for this solution to work, they are indeed changeable. The role of the script is only to write the default values when a "Carton" record is chosen, but after that the fields are yours entirely. This is perhaps what you were trying to achieve before resorting to Function fields, which copy the reference values at all times, and are thus not editable.