title: Fiori SAPUI5 - Get the complete target URL as string during Cross App Navigation
body: <p>I have a use case where I have to capture the target url as a string.</p>
  
  <p>I use cross App Navigation to navigate to another app.How do I build the same url that I get after the cross app navigation so that I can save it as a link that is shareable. </p>
  
  <pre><code>onNavigateToCampaign: function(event) {
      var campaignId = event.getSource().getBindingContext().getProperty("InitiativeId");
      if (jQuery.sap.getUriParameters().get("sap-hpa-shell")) {
          window.top.postMessage({
              id: "sap.hpa.shell.navigateTo",
              hash: "#INITIATIVE_TI",
              objectId: campaignId
          }, document.location.origin);
      } else {
          var fgetService = sap.ushell &amp;&amp; sap.ushell.Container &amp;&amp; sap.ushell.Container.getService;
          var oCrossAppNavigator = fgetService &amp;&amp; fgetService("CrossApplicationNavigation");
          if (oCrossAppNavigator) {
              oCrossAppNavigator.toExternal({
                  target: {
                      semanticObject: "Initiative",
                      action: "showDetail"
                  },
                  params: {
                      "id": [campaignId],
                      "sap-hpa-targetobject": ["INITIATIVE_TI"]
                  }
              });
          }
      }
  }
  </code></pre>