Welcome Guest.  • Login

AgriData Inc. Docs

Navigation


Search the wiki

»
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)
  • "lat" should be replaced with a control name or literal latitude number
  • "lon" should be replaced with a control name or literal longitude coordinate

=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)
  • "lat" should be replaced with a control name or literal latitude number
  • "lon" should be replaced with a control name or literal longitude coordinate

=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)
  • Field Name should be duplicated on the form and part of a group
  • Will display the maximum value of the controls that are named within the parentheses.
  • The max() function will ignore any field with a non-numeric value in it.
  • It is important to setup the properties of a text field to be a number or decimal format within the control properties.

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)
  • ControlName should be duplicated on the form and can be part of a Group
  • Will add up all numerical values of the control that is named within parentheses.
  • If there is a mix of numbers and words contained within the Field Name controls, then the words and numbers will concatenate each other depending on the order of the Tab Index set. If the words come at the beginning or end of the concatenation, a "0" will be placed before or after the word respectively. See: Caveats

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 (“Form”) - when placed in a text box it will automatically increment a number each time this specific form with a commonly named object (ie. text box) is generated. The number will increment separately for each location if applicable or if no locations are setup, within your entire company.
  • autoIncrement ("") - this is global, so it will increment a unique ID across all forms within the location if applicable, otherwise company.
    • The autoIncrement formula is most often used for reference numbers such as an invoice number that changes with every generated form automatically.

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:






  Name Size
- Insert formula drop.png 15.17 KB

Contact AgriData, Inc Support
Email:
Phone: (701)746-8580