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:
- To Add a Code Item by Using the Element Inspector
- To Add a Code Item by Using the Screen Editor
- To Add a Code Item on the Code page
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:
- Open the form in the browser.
- On the form title bar, click to launch the Element Inspector.
- 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.
- In the dialog box, click .
- 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.
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
, as the following screenshot shows.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:
- Open the customization project in the editor.
- Click Code in the navigation pane to open the Code page.
- Click Add New Record (+) on the page toolbar.
- In the Create Code File dialog box, which opens, select Graph Extension in the File Template box, as the screenshot below shows.
- In the Base Graph box, select the class name of the business logic controller to be customized.
- Click OK.
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.