Retrieve Information from a Session Variable

The values stored in a session variable can be displayed in any label, literal, textbox or dropdown list control using the SESSION function.  For example, to set the email address field on a Customers record to the value of the MyEmailAddress session variable, specify this formula for the “Initialize when Adding Record” event:

= SESSION(“MyEmailAddress”)

Filter table using session variable

The SESSION function can also be used in the Query Wizard to filter the items displayed in a table.

Step 1:  In the Layout Editor, select a table control.

Step 2:  In the Property Sheet, Queries section, select the appropriate query and open the Query Wizard (Edit…).

Step 3:  In the Query Wizard, add a new WHERE clause containing a formula that restricts the contents, e.g.:

= SESSION(“MyCity”)

Step 4:  Build and run your application.

Alternatively, you can constrain a FieldFilter control by specifying a formula for the “Populate from Database” event.

See Also

Common Formula Examples