on 11-24-2017 2:28 PM
I'd like to make use of SAP Cloud Platform's built in offline functionality.
Unfortunately the data will be far too large to implement offline, so I need to apply a filter to my defining requests.
"sap.mobile": {
"_version": "1.1.0",
"definingRequests": {},
"stores": [
{
"name": "ZSV_SURVEY_SRV",
"serviceRoot": "/SAPUI5-ABAP-SFI/",
"definingRequests": {
"SurveySet": "/Surveyset"
}
}
]
I know I can setup a filter as follows:
SurveySet$Filter=userID.
How is userID passed in though?
E.g it would ideally filter on the logged in user's records
Hi Midhun,
i given my given define requests as "
"definingRequests": {
"Dispositions": {
"dataSource": "mainService", "path": "/Dispositions?$filter=FromDate eq datetime'2017-12-05T00:00:00'&$expand=OrderOperations/SubOperations"
}
}
when im trying to read response data with model read , read function is not going to success to error please check below code for model read
filter.push(new sap.ui.model.Filter("FromDate", "EQ",date));
oModel.read("/Dispositions", {
filters: filter,
urlParameters:{"$expand" :"OrderOperations/SubOperations"},
success: function(oMasterData) {
}, error:function(error){
}
Can you please suggest me what will be an issue, will appreciate your reply.
Regards,
Saleem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi .
The filter will not necessarily always be on userId. Just when offline.
For example, the entity I'm referring to is RESULTS of a SURVEY (sorry this doesn't match my example.
When online, managers etc would want to view ALL results, they haven't stipulated they need offline for this.
However when completing the surveys (e.g. offsite, then offline is requested, but only for the user in question.
Anyway, here's the solution I found.... (component.js)
var _sapClient = "test";var oManifestUi5 = this.getMetadata().getManifestEntry("sap.mobile");
oManifestUi5.stores[0].definingRequests.SurveySet = "/SurveySet?filter=" + _sapClient;
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi adam,
by this process I got the answer but pls let me clear how to call "oManifestUi5" this one in definingRequest.
thanks
jai sharma
var _sapClient ="test";var oManifestUi5 = this.getMetadata().getManifestEntry("sap.mobile");
oManifestUi5.stores[0].definingRequests.SurveySet ="/SurveySet?filter=" + _sapClient;
The access to the odata service will be based on user logged on to the app right? i.e anyway he will be downloading the data specific to him. Then, why you need to put a filter in the query as userID?
If you can explain the use case maybe I can help you better.
Regards,
Midhun VP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.