Forms Designer - Insert Formula

Modified on 2023/09/13 22:24 by Adam — Categorized as: Uncategorized

Use the Insert Formula list within the Forms Designer to add some pre-defined commands to the formulas within to your Custom Form.

Image

Available Formulas:
Distance To the Map Center Point
Bearing To the Map Center Point
Max Value
Sum of the Values
Auto-Increment a number every time a new form record is saved

Remember! Place an equals sign(=) at the beginning of the text when using a formula.

Distance to Map Center
This formula is used to determine the distance in miles from a specific latitude and longitude to the center of the generated map or form.  
=distanceToMapCenter(lat, lon)

=distanceToMapCenter(41.113864,-96.86481)
or
=distanceToMapCenter(LatControl, LongControl)

Bearing to Map Center
This formula is used to determine the Bearing or a directional degree from a specific latitude and longitude point to the center of the generated map or form.
=bearingToMapCenter(lat, lon)

=bearingToMapCenter(41.113864,-96.86481)
or
=bearingToMapCenter(LatControl, LongControl)

Max
The Max formula will look at specified controls that are named the same and produce the Max value from them.
=max(Field Name)

Example: if we have 3 separate controls named "FieldB" on a form
FieldB = 50
FieldB = 90
FieldB = Dave100

The formula would be defined as
=max(FieldB)
and the result of will be
90


Sum
=sum(ControlName)

Example: 3 controls on a form template with the same name.
FieldA has a value of 40
FieldA has a value of 60
FieldA has a value of Bravo

If we were to use the sum command for these text fields it would look like this.
=sum(FieldA)
the result would be the following if the tab index was set in order from top to bottom.
100Bravo0

Auto Increment


AutoIncrement Example 1: In this example we are adding the increment formula to a text box named "InvoiceNumber" in a form called "Chemical Invoice"

Formula:

=autoIncrement"Form"


Result

 anytime the form "Chemical Invoice" is generated, the number in the "InvoiceNumber" 
text box will increase by one. 

Auto Increment Example 2: In this example we are adding the increment formula to a text box named "InvoiceNumber" in multiple forms called "Chemical Invoice, Fertilizer Invoice, and Seeding Invoice"


Formula:

=autoIncrement("")

Result

 Any time one of the 3 Invoice forms(Chemical Invoice, Fertilizer Invoice, and Seeding Invoice) are saved,
the "InvoiceNumber" number will increase by +1

How to set the starting number to increment from.

Many situations will necessitate a start of the increment number to be something other then "1". To do this, first generate a form that contains a control with the autoIncrement formula in it. Then click "Save Form". The form will reload and fill a number into the control. Now simply replace the loaded number with the number that you want to start with and click Save Form again. The autoIncrement formula references the highest number saved to know what number to put in the next form.

Have questions? Please contact Agridata Inc.

701-746-8580

Related Pages: