FORMULA LANGUAGE


Examples: Getting and setting environment variables
1. This example converts a number to text and saves it as an environment variable.
2. This example retrieves the value of an environment variable, converts it to a number, and stores it in a local variable.
3. This example is for a Computed when composed field. The formula maintains an environment variable named OrderNumber. When a new document is created, the formula retrieves the environment variable and increments it by 1. This algorithm does not work for databases that are replicated -- the database must exist on a single server or workstation and the formula must run on that same machine.
4. The first formula is run once by each sales person. This formula prompts for the sales area and makes it the value of an environment variable named SalesArea. In the form for the sales documents, you make the second formula the default value formula for the SalesArea field. This formula retrieves the value of the environment variable. The salesperson does not need to enter the sales area for each new document, and neither is a particular sales area hard-coded into the default value formula.
See Also