on 10-07-2021 9:59 AM
I set up bookmark functionalities and tried leveraging the "isDefault" flag as shown here in the Analytics Designer API Reference Guide.
However a "default" bookmark does not load when opening the application.
When loading the "default" bookmark in the "OnInitialization" Script, the Application goes into a loop as it's initializing again when applying the bookmark.
So my Question is: How was the default bookmark intended to work ?
Hello,
thanks for all the replies here.
We solved this issue similar to the suggestions you made here - via the onInitialization Script.
However, this will lead - as mentioned here already - to the behaviour, that the Application will load twice, which is not that good in matters of user experience.
But to me, this seems to be the only solution currently, as when adding the bookmarkId parameter to the url, all the users, who don't have a default bookmark defined, will see the error message "Bookmark not found".
This message can not be suppresed with Application.setMessageTypesToShow([]); as first statement in the onInitialization Script, as this is starting after the message was shown.
So this solution is even worse, as an error message directly when opening the application is really bad..
So from my point of view, there is still space for improvement on SAP Side 😉
Best regards,
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
agree, with the URL its even worse
Another solution would be to add a button, like "open with default bookmark" button. And load App in a new window, but its also a bad solution from my point of view
Probably there is an option to somehow force to load the function to load default bookmark before application is loaded, so its is less visible that i has been loaded twice
Anylway an improvement from SAP side would be better
Hey ,
I have solved it like this:
var bookmarks = BookmarkSet_UserSettings.getAll();
if ((BookmarkSet_UserSettings.getAppliedBookmark() === undefined) && (bookmarks.length > 0)) {
for (var i=0; i<bookmarks.length; i++) {
if (bookmarks[i].isDefault === true) {
BookmarkSet_UserSettings.apply(bookmarks[i]);
}
}
}
one bad thing is, that application will be loaded twice..not a really nice work around.
Another solution would be to share a link with "bookmarkId=DEFAULT" inside, but then only this link will work as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabian,
I've been trying to figure out the same thing. You need to include the paramter bookmarkId=DEFAULT in the application URL for the default bookmark to open directly. See chapter 5.21.2 in the developer handbook.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear fa_no,
I'm not familiar with the 'Default Bookmark', but we also offer the bookmark option within our application and we handle the onInit call as follows:
// LOADS THE COCKPIT
if (Application.getMode() === ApplicationMode.Present){
// DO SOME INITIAL SETTINGS
}
// RELOAD APP WITH MODE PRESENT
// WITHOUT BOOKMARK
else if (Application.getMode() !== ApplicationMode.Present && BookmarkSet_UserSettings.getAppliedBookmark() === undefined){
NavigationUtils.openApplication(Application.getInfo().id, UrlParameter.create("mode", "present"), true);
}
// WITH BOOKMARK
else {NavigationUtils.openApplication(Application.getInfo().id,[UrlParameter.create("bookmarkId",BookmarkSet_UserSettings.getAppliedBookmark().id),UrlParameter.create("mode","present")],true);}
Maybe this helps you to solve your issue.
Best regards
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.