on 04-27-2017 2:33 PM
Hello all,
I am having problems getting the current shell hash. In principle, I should be able to get want I want using the service sap.ushell.Container.getService("URLParsing"), but I'm encountering difficulties getting the app specific part.
Consider the code;
var oURLService = sap.ushell.Container.getService('URLParsing');
var sShellHash = oURLService.getShellHash(document.URL);
var oShellHash = oURLService.parseShellHash(sShellHash);
If the document URL is "TheThing-theAction?fld=1", oShellHas looks like this;
{ semanticObject: "TheThing", action: "theAction", contextRaw: undefined, params: {fld: ['1']}, appSpecificRoute: undefined}
The fld and '1' can be found in the paramaters
But if the URL is in a standard Fiori form like this;
LeaveRequest-manage&/detail/C81F66DA90A51ED785CA61B693549534
The getShellHash function returns "LeaveRequest-manage" so the parseShellHash obviously does not have the detail.
I could try to get the "/detail/C81F66DA90A51ED785CA61B693549534" by splitting the document.URL, but I'd prefer to use a more standard approach.
Can someone recommend a tidy way of extracting the part after the ampersand?
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.