1
votes

I'm trying to fix a major issue in another developer's code. Explaining the scenario and issue below. Any help towards a solution would be appreciated, thanks!

Apps and screens involved in the issue: Custom Fiori App 1 : Screen 1 (single view) , Screen 2 (master & detail view) Custom Fiori App 2 : Screen 1 (master & detail view)

Navigation To: In App1, on click of a button in Screen 1's footer, navigation is happening to Screen 2 in the same app. Now on click of a button in Screen 2's footer, the navigation is happening to App 2. - this is working fine. Navigation back: On click of the back button in the master page header, the navigation is supposed to happen to Screen 2 in App 1 since the user just came from there. But it is not working that way. It is going to Screen 1 of App1. Here is the code of the back function:

onBack:function()
{
  this.oRouter.detachRouteMatched(this.handleNavTo, this, this);
  var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
  oCrossAppNavigator.toExternal({
  target: {semanticObject : "ZManageAccount", action: "displayMangeAccount" }
  });
}
1
Your second routing code, navTo method check what's the third parameter - Sunil B N

1 Answers

0
votes

I have had issues with this navigation before as well.

I was able to make it work by providing a shellHash instead of semanticObject and action. (The target is still the same.)

onBack: function () {
    this.oRouter.detachRouteMatched(this.handleNavTo, this, this);
    sap.ushell.Container.getService("CrossApplicationNavigation").toExternal({
        target: {
            shellHash: "ZManageAccount-displayMangeAccount"
        }
    });
}