To Customize an Existing Business Logic Controller

You can create the class extension for an existing business logic controller (BLC) and add the Code item with the created code to a customization project in several ways, as described in the following sections:

If you need to extend the code of a BLC that has no webpage associated (such as ARReleaseProcess), follow the instructions described in To Add a Code Item on the Code page.

As soon as you add the Code item for customization of the business logic to the project, the system generates an extension class for it and opens the code in the Code Editor. You can work with the extension classes in the Code Editor. After you publish the customization project, you can develop the code in MS Visual Studio.

To Add a Code Item by Using the Element Inspector

Typically, you want to modify the business logic that is executed for a certain form of MYOB Acumatica.

To add a Code item for customization of the business logic for an existing form to a customization project by using the Element Inspector, perform the following actions:

  1. Open the form in the browser.
  2. On the form title bar, click Customization > Inspect Element to launch the Element Inspector.
  3. On the form, select any UI element to open the Element Properties Dialog Box for the element.

    The Business Logic box of the dialog box displays the name of the business logic controller that provides business logic for the form, as shown in the screenshot below.

  4. In the dialog box, click Actions > Customize Business Logic.
    Figure 1. Using the Element Properties dialog box to customize the business logic for the form


  5. If there is no currently selected customization project and the inspector opens the Select Customization Project Dialog Box, select an existing customization project or to create a new one.

The platform creates the template of the class that is derived from the PXGraphExtension<> class, saves the code as a Code item of the project in the database, and opens the item in the Code Editor, as shown in the following screenshot.

Figure 2. Viewing the created code template in the Code Editor


To Add a Code Item by Using the Screen Editor

Often, you start a customization of an MYOB Acumatica form in the Screen Editor and you later want to modify the business logic for this form. To customize the business logic of the form, you can add a Code item to a customization project from the Screen Editor.

To do this, on the toolbar of the Screen Editor, click Actions > Customize Business Logic, as the following screenshot shows.

Figure 3. Starting the customization of the business logic from the Screen Editor


The platform creates the template of the class that is derived from the PXGraphExtension<> class, saves the code as a Code item of the project in the database, and opens the item in the Code Editor.

To Add a Code Item on the Code page

If you know the name of the business logic controller to be customized, you can create a Code item with the graph extension template on the Code page of the Customization Project Editor by using the Create Code File dialog box.

To do this, perform the following actions:

  1. Open the customization project in the editor.
  2. Click Code in the navigation pane to open the Code page.
  3. Click Add New Record (+) on the page toolbar.
  4. In the Create Code File dialog box, which opens, select Graph Extension in the File Template box, as the screenshot below shows.
  5. In the Base Graph box, select the class name of the business logic controller to be customized.
  6. Click OK.
    Figure 4. Adding a Code item with the graph extension to the project


The platform creates the template of the class that is derived from the PXGraphExtension<> class, saves the code as a Code item of the project in the database, and opens the item in the Code Editor.