Creating a Button that Calls an Action Script
Configure a button that uses an action script and the OnPush Event. This page contains a code explanation.
Button2 uses an Action Script to copy the customer billing address to the shipping address. Button2 uses a bitmap instead of text to define its purpose.
The following procedure assumes that the developer has opened the form in the Form Editor. Follow these instructions to create a button similar to Button2 :
Place a button on the form.
On the resulting Define Button dialog box click the Define Picture button.
Click the Internal combo box to open it up.
Select the image in the resulting Insert Image dialog box.
Click the Addin images radio button.
Click the Insert button.
In the Define Picture dialog box click the OK button.
In the Define Button dialog box click the Next button.
Click the Add New Action button to start defining an Action Script (refer to ((|#Button2_OnPush_Event|Button2 OnPush Event)) ).
If you are in the Code Editor, close and save your code.
Click the Finish button.
Clicking Button2 runs the following Action Script, which displays a dialog box to confirm that the user wants to copy the shipping address to the billing address and copies the shipping address to the billing address.
Display a Message Box(ID 'copyAddress') Set Field Values
The follow Action displays a message box to confirm that the user wants to copy the shipping address to the billing ' address.
Display a Message Box(ID 'copyAddress')
If the user clicks OK, the following Action copies: Ship_country to Bill_country, Ship_zip to Bill_Postal_Code, Ship_state to Bill_State_Region. Ship_city to Bill_city, Ship_address_1 to Bill_address_1, and Ship_address_2 to Bill_address_2.
Set Field Values