on 2021 Mar 15 12:51 PM
Hi Team,
Need some inputs on handling a scenario in which a certain oData calls returns around 3k records and need to process these 3k records to form a filter to pass to another oData .
right now when this filter array is passed to another oData call the call was failing since filter array was very huge
below is the code snippet to form filters from first odata call
var oFilter = [];
var oFilterORTotal = [];
if (oData1.results.length > 0) {
oData1.results.forEach(function (oItem) {
oFilter.push(
new sap.ui.model.Filter({
filters: [
new sap.ui.model.Filter("field1", sap.ui.model.FilterOperator.EQ, oItem.field1),
new sap.ui.model.Filter("field2", sap.ui.model.FilterOperator.EQ, oItem.field2),
new sap.ui.model.Filter("field3", sap.ui.model.FilterOperator.EQ, oItem.field3),
new sap.ui.model.Filter("field4", sap.ui.model.FilterOperator.NE, "X")
],
and: true
})
);
});
}
var oTotalFiltersData = new sap.ui.model.Filter({filters: oFilter});
oFilterORTotal.push(oTotalFiltersData);
oData2.read(url, {
filters: oFilterORTotal,
urlParameters: {},
success: function (oData) {
},
error: function (error) {
}
});
in the above code snippet the oFilterORTotal array length is above 3k and oData call is failing.
is there any way to handle this scenario in a more effective way to pass the second oData call.
Regards
Prasad
Request clarification before answering.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.