Skip to Content
0

How to navigate from Fiori apps to Launchpad Homepage?

3 days ago

80

avatar image

Hi all,

I have a Master-detail Fiori application deployed to Fiori Launchpad. I have a home button in the master page which on clicking should navigate to Fiori Launchpad Home Page. I tried the various possible ways which was mentioned in various blog posts. Nothing worked for me. Here's the code what I have tried:

Method-1:

var oHistory = sap.ui.core.routing.History.getInstance(), 
sPreviousHash = oHistory.getPreviousHash(), 
 oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
 if (sPreviousHash !== undefined) {
	 // The history contains a previous entry 
history.go(-1);
		 } 
else {
	 // Navigate back to FLP home 
 oCrossAppNavigator.toExternal({ 
 target: { shellHash: "#" } 
 });
 }

I get 'Cannot read property getService() of undefined error'.

Method-2:

var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");  
 oCrossAppNavigator.toExternal({  
target: { semanticObject : "#"}  
 });

Method-3:

var sPreviousHash = History.getInstance().getPreviousHash(),
oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
if (sPreviousHash !== undefined || !oCrossAppNavigator.isInitialNavigation()) {
history.go(-1);
} else {
oCrossAppNavigator.toExternal({
target: {shellHash: "#Shell-home"}
});
}

Can someone suggest me with this?

Regards,

Ramya

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

1 Answer

Sharath M G 3 days ago
0

Can you attach the error on console or screenshot of the issue.

Regards.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sharath,

Here's the error Screenshot.

0