|
Sometimes, you want to place a button on your Form that performs one of the commands available on the Sesame command menu tree, such as switching to the Application Menu tab. To run code when a command button is clicked, place your code in the On Element Entry event of the command button.
1. Open your Form in Designer.
2. Place a command button on your Form.

3. Open the Programming Editor by selecting Program Layout from the Commands Control Panel. Select your Command Button from the Element dropdown. Select On Element Entry from the Event dropdown.

|
4. Type the program in the Program Editor window.
var vRet as Int
If(@Mode() = 0)
{
vRet = @SelectTreeItem("Add Data Menu!Application Menu")
}
Else If(@Mode() = 1)
{
vRet = @SelectTreeItem("Search Update Menu!Application Menu")
}
5. Test your program by selecting Test Program from the Test menu. Fix any syntax errors that are reported.
6. When you are finished, select Close Program Editor from the File menu. Your programming changes will be saved when you save your Form.
Don't forget to save and reconcile your changes!
More Information: Using the Program Editor Programming Guide - Page 15 - 24
@SelectTreeItem() Programming Guide - Page 160 - 161
|