Skip to Content
0

Fiori - CRM Extension Mock Data not loading

Nov 22, 2016 at 07:39 AM

86

avatar image
Former Member

Hi ,

I have created an Extension project for CRM My Accounts app and im trying to use mock data for the same. I have placed the metadata.xml for the odata '/sap/opu/odata/sap/CRM_BUPA_ODATA' in the model folder and successfully started the MockServer in the Component.js.

When i run the index.html, i see the ui is rendered but without any data. I also tried to generate the Mockdata json files for all the collections still no luck. Could you please help? Below is the Component.js

jQuery.sap.declare("cus.crm.myaccounts.CRM_MYACCOUNTSExtension.Component");
jQuery.sap.require("sap.ui.core.util.MockServer");
// use the load function for getting the optimized preload file if present
sap.ui.component.load({
name: "cus.crm.myaccounts",
// Use the below URL to run the extended application when SAP-delivered application is deployed on SAPUI5 ABAP Repository
url: "/sap/bc/ui5_ui5/sap/CRM_MYACCOUNTS" // we use a URL relative to our own component
// extension application is deployed with customer namespace
});
this.cus.crm.myaccounts.Component.extend("cus.crm.myaccounts.CRM_MYACCOUNTSExtension.Component", {
metadata: {
version: "1.0",
config: {
"sap.ca.i18Nconfigs": {
"bundleName": "cus.crm.myaccounts.CRM_MYACCOUNTSExtension.i18n.i18n"
}
},
customizing: {
"sap.ui.controllerExtensions": {
"cus.crm.myaccounts.view.S2": {
"controllerName": "cus.crm.myaccounts.CRM_MYACCOUNTSExtension.view.S2Custom"
},
"cus.crm.myaccounts.view.overview.OverviewPage": {
"controllerName": "cus.crm.myaccounts.CRM_MYACCOUNTSExtension.view.overview.OverviewPageCustom"
}
},
"sap.ui.viewModifications": {
"cus.crm.myaccounts.view.overview.GeneralData": {
"ratingLabel": {
"visible": false
},
"ratingText": {
"visible": false
}
}
},
"sap.ui.viewExtensions": {
"cus.crm.myaccounts.view.overview.OverviewPage": {
"extKpiBox": {
"className": "sap.ui.core.Fragment",
"fragmentName": "cus.crm.myaccounts.CRM_MYACCOUNTSExtension.view.overview.OverviewPage_extKpiBoxCustom",
"type": "XML"
}
},
"cus.crm.myaccounts.view.maintain.GeneralDataEdit": {
"extEditForm": {
"className": "sap.ui.core.Fragment",
"fragmentName": "cus.crm.myaccounts.CRM_MYACCOUNTSExtension.view.maintain.GeneralDataEdit_extEditFormCustom",
"type": "XML"
}
}
}
},
fullScreenPageRoutes: {
"subdetail": {
pattern: "detail/{contextPath}/{selectedTab}/{filter}",
view: "overview.OverviewPage"
}
}
},
init: function () {
// create
var oMockServer = new sap.ui.core.util.MockServer({
rootUri: "/sap/opu/odata/sap/CRM_BUPA_ODATA/"
}); 
var oUriParameters = jQuery.sap.getUriParameters();
// configure
sap.ui.core.util.MockServer.config({
autoRespond: true,
autoRespondAfter: oUriParameters.get("serverDelay") || 1000
});
// simulate
var sPath = jQuery.sap.getModulePath("cus.crm.myaccounts.CRM_MYACCOUNTSExtension.model");
oMockServer.simulate(sPath + "/metadata.xml", {sMockdataBaseUrl:sPath,bGenerateMissingMockData: true} );
// start
oMockServer.start();
}

});
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers