A simple way to extract MES Queries from the current MES User Interface is to use Fiddler: http://www.fiddler2.com/fiddler2/
Install this program on your computer.
To grab the MES Query for a specific list box take the following actions (see below for the corresponding screen grabs):
- Open the MES System
- Select the list box you would like to get the MES Query from (The query that created the data that is shown in the listbox)
- Open the fiddler program.
- Press CNTR X to clear all displayed events
- Press the Excel Export button in the MES Application
- This will show a couple of new lines in Fidler
- Click the line above the /ExcelExport.ashx
- In the right panel click the Inspectors main tab
- Click the Header sub tab
- Scroll down and see if under ‘Miscellaneous’ it shows:
X-AjaxPro-Method: mGenerateExcelFile - If so, you have the correct request.
- Go to the TextView sub tab. This will show you the query that was sent to the server to get you the Excel Data for the listbox.
10) You can view it in the Notepad editor
After opening Fiddler and pressing CTRL X press the Excel Export in the MES Application. If you were fast you will get what is show in the above picture, with only 2 sessions shown in the left pane.
The first sends the list box query to the server. The second is the reply of the server. To get the MES Query, click the first session.
In the right pane, click the Inspectors tab and click the Headers sub-tab and scroll down. Here you will see the name of the request sent to the server under under ‘Miscellaneous’ it shows:
X-AjaxPro-Method: mGenerateExcelFile
When you click the TextView sub tab, you will get a display of the full command that was sent to the server. From this text you can extract the 4 parameters you need for the EZ_SoapReader.
To make it easier you can click the ViewInNotepad button.
To test the query in the EZ_SoapReader you have to extract the EZ_SoapReader arguments:
- "arJSColm" is S_arJSColm.
Copy the square brackets behind the colon (in cluding al content, it can help you put in some carriage returns, but remember to remove them when you cut and paste into the EZ_SoapReader) - "o" is S_o
Copy the curly brackets with the content and paste it into the EZ_SoapReader - "arCheckVals" = S_arCheckVals
Copy the square brackets with content. - "oSort" = S_oSort
Copy the curly brackets with content
[…] Square brackets represent an Array in JSON
{…} Curly brackets represent an Object in JSON
Source: http://www.json.org/