Troubleshooting m-Power Applications
Debug SQL Statement
When the application is run, you can see the exact SQL statement used by m-Power to generate the query returned to the screen. Developers can also see a list of any parameters that are being sent through the form submission.
To activate our basic debugging option, developers have two options:
Option A: Go into Application Properties and set the "Enable Debugging" option to 'Yes'. Debugging will now remain on, until this option is changed back to 'No'.
Option B: An alternative method to activating this debugging option is to forgo setting the application property and instead add ?debug=1 to the end of your application URL. Doing so will turn on the debugging logic only for this single visit. Once the developer has navigated away from this page, they will lose their debugging feature.
In either case, the SQL statement can now be analyzed for accuracy.
This advanced debugging method is extremely helpful to users creating powerful web applications using imported applications. To better understand imports, they include multiple child applications nested in a parent application via an import statement.
By applying debug=2 to the URL, the developer's parent application will change dramatically. Rather than rendering each individual child application, the page will instead replace the rendered child app with the URL used to call this child app. This is extremely helpful when an imported application is not behaving as you would expect and you want to verify that you are calling the correct application and passing the correct parameters.
With the help of debug=1 or debug=2, an m-Power developer can debug many issues that may be encountered to when building applications.
Using the URL to call applications can be very helpful when developing applications, especially when using links. However, sometimes knowing which parameters are available for your application can be difficult to remember. The August 2015 release of m-Power includes a runtime parameter listing that will list available global web parameters as well as template specific parameters that you can use with your application.
Included in this new feature is the ability to build and execute the URL with the parameters you choose. The parameter listing page will pull in the fields directly from your app specs and apply them to the available parameters. Instead of showing you "S_[INSERT_FIELD_HERE]=1", there will be options for the fields that apply to that parameter(e.g. S_CUSNO=1, S_CNAME=1, and so on). Simply clicking on the desired parameter will add it to the running URL being generated at the top of the page.
To launch this feature, simply add ?help=1 to the end of the URL and hit Enter.
You will see the template and current URL from the application. The first tab includes a listing of all general parameters with a description, valid values, default value and an example of the parameter being used. Clicking a parameter's name will add it to the running URL at the top. If parameter value is dynamic, simply enter the desired value into the text box. If the parameter value is limited to set values, choose the desired value from the dropdown. To remove a parameter, click on the red 'X' in the running URL. Clicking "Run URL" will execute the URL you've created. The ?help=1 parameter will be dropped when executing the URL.
The second tab is a listing of all parameters that are specific to the template being used. Clicking on the available parameters will add them to the running URL as well.
Applications compiled prior to the August 2015 update will only have the generic parameters available. The app will need to be recompiled before the template specific parameters will be available.
The parameter listing only supports standard templates that are shipped with m-Power.
Some parameters are dependent on other parameters being included in the URL. If this is true with the parameter you choose, the dependent parameter(s) are appended as well.
All parameter values need to be URL-encoded in order to work correctly. If there is a value that is not URL-encoded, you will receive an alert when trying to execute the URL.