cancel
Showing results for 
Search instead for 
Did you mean: 

how to Access sap.ushell.Container.getService("CrossApplicationNavigation") in CustomUI5 app

govardan_raj
Contributor
0 Kudos

hi ,

we have a Custom UI5 app, from which we wish to navigate to another UI5 App using CrossApplicationNavigation.

but in my Custom UI5 app, am getting error as on using this code.

var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
VM784:1 Uncaught TypeError: Cannot read property 'getService' of undefined
    at <anonymous>:1:47

my UI5App is deployed on SAP Enterprise Portal.

Regards

Govardan

View Entire Topic
junwu
Active Contributor
0 Kudos

I think you have to run it in fiori launchpad.

if you run it as standalone app, you won't have it.

govardan_raj
Contributor
0 Kudos

hi Jun WU,

Am running my custom UI5 App in fiori launch pad only , but getting above error.

Regards

Govardan

govardan_raj
Contributor
0 Kudos

I tired including this ffp-bootstrap.js file at Index.html as shown below

<script src="/com.sap.portal.navigation.flp.resources/scripts/optimize/ffp-bootstrap.js?"></script> 

& in respective controller ?

 sap.ui.define([
	 
	"sap/ui/model/json/JSONModel",
	'sap/m/MessageToast',
	'sap/m/MessageBox',
	'sap/ushell/services/CrossApplicationNavigation',
	'sap/ushell/services/Container',
], function (BaseController, JSONModel, MessageToast, MessageBox,Container) {
.
.
.
.
.,_crossAppNavigation:function(){
jQuery.sap.require("sap.ushell.services.CrossApplicationNavigation");
var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
 var hash = (oCrossAppNavigator && oCrossAppNavigator.hrefForExternal({
 target: {
	    semanticObject: "EP--123****23-CHILD_APP_NAME",
		 action: "display"
	 },
	  params: {
			 ClaimNumber : ClaimNo
		 }
		 })) || ""; // generate the Hash to display a Supplier
		 oCrossAppNavigator.toExternal({
					  target: {
					         shellHash: hash
					  }
    });




},
.
.
.
.
.



Even then am not able to navigate.

junwu
Active Contributor
0 Kudos

if you are using index.html, that doesn't look like you are running in flp.

govardan_raj
Contributor
0 Kudos

Even though index.html is available , we have created URL iview for the same and assigned category Id of FLP .

junwu
Active Contributor
0 Kudos

just run your portal flp, go to console,check if you can get

sap.ushell.Container.getService("CrossApplicationNavigation")

govardan_raj
Contributor
0 Kudos

on clicking my portal FLP outside the tile area in the launch pad , and checking the below in the console am able to access the getService of the sap.ushell.Container.

sap.ushell.Container.getService("CrossApplicationNavigation") 

but the same is not working when executed from my customer ui5app controller.

junwu
Active Contributor
0 Kudos

check this.

https://launchpad.support.sap.com/#/notes/2694687

your app is running as standalone, I believe.

check in your developer tool if your app is under a iframe.