Portable Fragment Bookmarks are a very powerful and useful feature in SAP BusinessObjects Design Studio. It allows users to create bookmarks of an application and share it with business users. When a bookmark is saved to a folder, users with access to that folder can retrieve the bookmarks.

At Visual BI Solutions, we had a scenario where we had to populate all the fragment bookmarks for an application in a listbox and let the users open the required fragment bookmark. When implementing Portable Fragment bookmarks and running SAP BusinessObjects Design Studio on BI platform mode, we ran into one drawback – that is that the bookmarks get replicated on the platform when different users open the same bookmark. This causes the bookmark folder to have replicas of the same bookmark. When listing the available bookmarks in a listbox, this causes the list to have replicas and the list becomes confusing.

To overcome this, we can use scripting to remove duplicates from the listbox of saved bookmarks and also to delete all the associated(replica) bookmarks when we delete a particular bookmark.

To Load only the original bookmark in the List box:

We can check for duplicates with respect to the title of the bookmarks, since each of the replica bookmarks has a unique id.

var bmk = Bookmark.PortableFragmentBookmark.getAllBookmarkInfos("ONLINE_COMP"); 
                                    //Retrieving all the bookmarks of the folder
var list="";   //String to save the unique bookmark titles
bmk.forEach(function(element, index) {
if(Convert.indexOf(list, element.title)==-1){   //Checking for replica
LISTBOX_SAVED_ANALYSIS.addItem(element.id, element.title);
}
list=list+";"+element.title;    //Adding bookmarks to a listbox
});

To Delete a Portable Fragment bookmark and its replicas:

var title= "";
if (LISTBOX_SAVED_ANALYSIS.getSelectedValue()!="")
{
title = LISTBOX_SAVED_ANALYSIS.getSelectedText();
var bmk1 = Bookmark.PortableFragmentBookmark.getAllBookmarkInfos("ONLINE_COMP");
bmk1.forEach(function(element, index) {
if (element.title==title)
{
Bookmark.PortableFragmentBookmark.deleteBookmark(element.id);
}
});
LISTBOX_SAVED_ANALYSIS.removeAllItems();

Load the list box as mentioned earlier, so that no more replicas are present.

One limitation of this workaround is that not more than 1 bookmark can have the same name even though the enterprise IDs may change. While creating bookmarks, this is a useful work-around to include in our application to avoid such scenarios during sharing of the bookmarks.

Learn More

Subscribe to our Newsletter

5920 Windhaven Pkwy
Plano TX 75093.

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com