Skip to Content
0
Jan 16, 2020 at 06:59 AM

offline store mobile cloud platform

51 Views

Hey all,

my question is how to declare more than one service in sap-mobile-hybrid.js

for offline application.

thank you in advance

openStore: function () {
    	jQuery.sap.require("sap.ui.thirdparty.datajs");
    	var properties = {
    		"name": "offlineService",
    		"host": sap.hybrid.kapsel.appContext.registrationContext.serverHost,
    		"port": sap.hybrid.kapsel.appContext.registrationContext.serverPort,
    		"https": sap.hybrid.kapsel.appContext.registrationContext.https,
    		"serviceRoot": fiori_client_appConfig.appID + "_mssampledata/SampleServices/ESPM.svc/",
    		"definingRequests": {
    			"productsSet": "/Products/?$expand=StockDetails"
    		}
    	};
    	store = sap.OData.createOfflineStore(properties);
    	var openStoreSuccessCallback = function () {
    		sap.OData.applyHttpClient(); //Offline OData calls can now be made against datajs.
    		sap.hybrid.startApp();
    	}
    	var openStoreErrorCallback = function (error) {
    		alert("An error occurred" + JSON.stringify(error));
    	}
    	store.open(openStoreSuccessCallback, openStoreErrorCallback);
    },

regard

jai sharma