Code Editor

Page ID: (AU204000)

On this page, you can develop, view, and edit the customization code that has been added to the project. The name that appears on the page is Code Editor: followed by the object name of the Code item whose code you are viewing.

Tip: You open the Code Editor for any Code item by clicking the link in the table on the Code page or by clicking its name under Code in the navigation pane. You can also open the Code Editor from an MYOB Advanced form by clicking Customization > Inspect Element to open the Element Properties dialog box, and then clicking Actions > Customize Business Logic.

Page Toolbar

The page toolbar includes standard and page-specific buttons and commands. For the list of standard buttons, see Page Toolbar. The page-specific commands are listed in the following table.

Button Description
Move to Extension Lib.

Launches the operation that converts the current Code item into a file of customization code, adds the file to the extension library project in Microsoft Visual Studio, and removes the item from the customization project. See the To Move a Code Item to the Extension Library for details.

Note: The customization project must be bound to an existing extension library project in Visual Studio before you click the Move to Extension Lib. button. See Customization Project Editor for details.
New Action

Opens the Create Action dialog box, which you can use to create a code template for a new action.

Open Screen

Opens the form bound to the business logic controller if you are editing the customization code of the business logic executed for a form.

Override Method

Opens the Select Methods to Override dialog box, which you can use to select multiple virtual methods of the business logic controller (BLC) to override.

View Source

Opens the Source Code Browser (see Source Code) with the original source code of the BLC if you are editing the customization code of the business logic executed for a form.

Table 1. Create Action Dialog BoxThis dialog box opens when you click New Action on the page toolbar. By using the dialog box, you can create an action in the business logic controller whose extension you are viewing in the Code Editor. The dialog box contains the following elements.
Element Description
Action Name

The name of the action delegate method.

Display Name

The name of the action that will be displayed on the applicable MYOB Advanced form.

This dialog box has the following buttons.
OK

Adds the template of the action declaration to the graph extension and closes the dialog box.

Cancel

Closes the dialog box without any changes.

Table 2. Select Methods to Override Dialog BoxThis dialog box opens when you click Override Method on the page toolbar. The dialog box contains the list of the virtual methods of the current BLC and its parent classes.

When you override a virtual method, the system generates an overridden method template that includes the delegate declaration of the base method, the PXOverride attribute, and the method declaration that invokes the base method delegate.

Column Description

The table in the dialog box contains the following columns.

Selected

A check box that you select to indicate that the virtual method will be overridden in the BLC extension.

Type

The identifier of the class type that contains the declaration of the virtual method.

Method

The signature of the virtual method.

This dialog box has the following buttons.
Save

Adds to the graph extension a template of an overridden method for each method selected in the table.

Cancel

Closes the dialog box without any changes.

Source Code Pane

You use the Source Code pane of the Code Editor page to view and edit the code for the Code item that you opened from the navigation pane or the Code page.