Hi everyone,
I am trying to get records from a grid and filter the grid in Extensible Framework.
I had a more complicated example where I am trying to get information from the parent part while on the manufacturer's tab (using a grid) and that did not work.
So I came up with a more simple example and hopefully someone can point out what I am doing wrong when trying to filter the grid to display only one WO Number (EVT_Code) – the one I’m on.
We are Infor EAM 11.3 Build 201804.
The Grid:
-> Record View tab
Grid ID: 101093
Grid Name: KUTEST
Grid Description: Test WO grid for EF
Grid Type: List View
FROM Clause: r5events
SELECT Clause: EVT_CODE wonumber
WHERE Clause: 1=1
-> Fields tab
Field: EVT_CODE
Alias: wonumber
Field Label: wonumber
Grid Key: checked
NOTE: The Default Dataspy has been created and the grid is active
On the validation tab the Default Dataspy is: select EVT_CODE wonumber FROM r5events WHERE 1=1
And if I run the query in SQL Developer it will give me the following result
10000
100000
100001
The code in Extensible Framework
Ext.define('EAM.custom.external_wsjobs', { extend : 'EAM.custom.AbstractExtensibleFramework',
getSelectors : function () {
return {
'[extensibleFramework] [tabName=HDR][isTabView=true]': {
afterloaddata: function() {
console.log('HDR after load data');
var vFormPanel = EAM.Utils.getCurrentTab().getFormPanel();
var vWO = vFormPanel.getForm().findField("workordernum");
var vWOValue = vWO.getValue();
console.log('vWOValue: ' + vWOValue);
response = EAM.Ajax.request({
url: 'GRIDDATA',
params: {
GRID_NAME: 'KUTEST',
REQUEST_TYPE: 'LIST.HEAD_DATA.STORED',
LOV_ALIAS_NAME_1: 'wonumber',
LOV_ALIAS_VALUE_1: vWOValue,
LOV_ALIAS_TYPE_1: 'text'
},
async: false,
method: 'POST'
});
var gridresult = response.responseData.pageData.grid.GRIDRESULT.GRID;
var vCode = gridresult.DATA[0].wonumber;
var vCode1 = gridresult.DATA[1].wonumber;
var vCode2 = gridresult.DATA[2].wonumber;
console.log('vCode: ' + vCode + ' ' + vCode1 + ' ' + vCode2);
}
}
}
}
});
In Google Chrome, if I press F12 (to look at the Console) no matter what WO I click I see the same result.
The output for "console.log('vCode: ' + vCode + ' ' + vCode1 + ' ' + vCode2);" is: vCode: 10000 100000 100001
Those are the same values from the result set in SQL Developer so obviously the grid is not filtered.
Can someone please point out what I am missing?
BTW If you think there is a better way to get information from the record view while on another tab feel free to share your thoughts.