Implement Abilities to Control the Code Generation Process to Control the Application Behavior

Implement Abilities to Control the Code Generation Process to Control the Application Behavior


CustomFormButtons.inc is a good example to exemplify the addition of custom code within the test application presented in this document. In this example, we will be adding a button to navigate to a specific form ‘Supplier Info’.

Adding the custom code requires adding an /(include..) tag at an appropriate place, then creating the referenced include file with the custom code. This is similar to adding an Edit Point in PLEX to add inherited code.

Eclipse

In Eclipse look for CustomFormButtons.inc and add the code for ‘Supplier info’ button:


The form is therefore going to include a new button ‘Supplier Info’ which will display in the region where ‘Product Info’. ‘Custom Demo’, and ‘Customer Info’ buttons exist.

After we have the code add an /(include..) tag at an appropriate place:


Then run the Application Generator:


When the application is up and running:

  1. Click on Application Settings and then click in apply:

  2. Click on Application Template, select Gen Folder, and Generate Application. Wait for the message that all was generated succesfully:

Now right click and refresh the web project:


Run tomcat server:


Test Changes

Note how the new button is displayed and can be used to navigate to the specified form:




    • Related Articles

    • Running the Source Code Scanner

      After an application subdirectory has been loaded into the scanning directory with a valid app.properties file, it will be entered into the source code scanner as a job with pending status. With a web browser on the scanning server, navigate ...
    • How to Terminate a WebClient Session Via a Source Code

      Create a source code object called “CloseSession” and add this code: javax.servlet.http.HttpServletRequest req =  (javax.servlet.http.HttpServletRequest) getApp().getFromUserStorage("javax.servlet.http.HttpServletRequest" ); if (req != null) { ...
    • How to solve the Invalid method Code length issue?

      This issues is b/c  the Java code Hit Java limit, which human is impossible to hit but generator hits, this is Java limitation that does not exist in RPG, here is the information you will need in order to solve the issue in the specific functions but ...
    • M3 Batch Process

      M3 Batch Processor Flow: The M3 web application inform the M3 run-time the next function call is to be processed asynchronously as a Batch Job M3 creates a JSON document that describes the function to call and its parameters M3 run-time redirects the ...
    • How to implement file viewer in WebClient using Office Web Viewer

      Reference https://www.microsoft.com/en-us/microsoft-365/blog/2013/04/10/office-web-viewer-view-office-documents-in-a-browser/ How to implement the FileViewer.ctrl The FileViewer.ctrl template is applied over an edit control in your Plex panel, at ...