Skip to Content
Author's profile photo Robert Mullen

Sharing a bookmark by e-mail in SAP Lumira 2.x

In SAP BusinessObjects Design Studio 1.6 it was possible to share bookmarks by e-mail using the bookmarks.shareBookmark(id) API. This script call opened a prompt dialog box containing the URL link to the bookmark. There was also an additional button that would create a new e-mail using your local e-mail client.

Since Lumira 2.x this Bookmark sharing functionality has been deprecated. The e-mail functionality now allows you to create e-mails with any content that you want. You can now create e-mails with content other than just Bookmark URLs. The API call is:

APPLICATION.sendEmail(StringArray receivers, String subject, String content);

You can pre-populate some of the e-mail data prior to sending it off to the local e-mail client.

Firstly remember that you can only share Bookmarks with a Global access type. Bookmarks with a Personal access type can only be viewed by the users that created them. You can simply get the URL of the relevant Bookmark and pass it to the new API. For example, you have listed all of your Bookmarks in a ListBox. The code snippet below shows how you might share a specific Bookmark in the ListBox after selecting it:

var bookmarkId = LISTBOX_1.getSelectedValue();
var url = BOOKMARK_1.getUrl(bookmarkId);
APPLICATION.sendEmail([“help@sap.com”], “Sharing a bookmark via email”, url);

 

You can use the onClick event of a button, or some other element to trigger the above script. Once you call the script you will get your new e-mail created in your local e-mail client:

So now you can send e-mails to your colleagues containing a direct link to a given Global Bookmark.

If you wanted a popup prompt like the 1.6 behavior, you can construct one quite quickly using a Dialog component:

In the example above, you have a Dialog containing an Icon, an InputField and a Button. Then do the following:

  1. Add the following onClick to the Icon:
    1. APPLICATION.openNewWindow(INPUTFIELD_1.getValue());
  2. Set the InputField property ‘editable’ to false
  3. Add the following onClick to the ‘Send by e-mail’ button:
	APPLICATION.sendEmail(["help@sap.com"], "Sharing a bookmark via email", INPUTFIELD_1.getValue());

Now you have a Dialog prompt to share Bookmarks by e-mail. However, the flexibility of the API in 2.x will allow application designers to use the e-mail functionality across the application and not just for Bookmarks.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Özlem Öztürk
      Özlem Öztürk

      Hi Robert,

      thanks for your helpful feed.

      We have some problems sending bookmarks in Lumira. We get the Bookmark ID like in your example, the email content looks fine containing the application and bookmark ID, but when trying to open the link the application throws an error:

      "Cannot reset status of application."

       

      Do you have any idea what might be wrong?

       

      Thanks,

      Oezlem

      Author's profile photo Robert Mullen
      Robert Mullen
      Blog Post Author

      Hi Özlem,

      Generally this message is only an INFO level message and doesn't necessarily mean that the bookmark was not loaded correctly.

      If you are just getting INFO level messages in the application that say this then it can probably be ignored. The application log level severity could be changed also if your users are concerned about it.

      In you instance does the bookmark load correctly or does the application get an error and not open at all?

      If it's the latter then you would be better off opening an incident as it would probably take some time to debug it and see why it is not loading correctly.

      Kind Regards,

      Robert

      Author's profile photo Rakesh Konduru
      Rakesh Konduru

      Hi Robert,

       

      Very useful blog and helpful information.

      I have a similar kind of requirement in which we already have Design Studio 1.6 Dashboard and old bookmarks API written in Event Onclick for Share Workbook Button. Now i am able to achieve the email function to share bookmarks writing below command in on click event for Share Workbook button.

      APPLICATION.sendEmail(StringArray receivers, String subject, String content);

      Can you throw some light on how to get the pop-up window also in the same onclick event of already existing button Share Bookmark.

      I did try the Dailog Component option that is mentioned in the blog but how to add this to the already existing Button Share Bookmark is the open question.

      Thanks,

      Rakesh

       

       

       

       

       

       

      Author's profile photo Robert Mullen
      Robert Mullen
      Blog Post Author

      Hi Rakesh,

       

      It completely depends on what the script contents of your "Share Workbook" button are. To me it sounds like you already had something like:

      Bookmark.shareBookmark("<some way to retrieve the bookmark id>");

      The deprecated Bookmark.shareBookmark call already opened a Popup with a link and a button that created an email. This post is simply a way to recreate that using the modern APIs with the new Bookmark Technical component.

      I would not suggest mixing the approaches as they use different APIs and you could end up with multiple open dialogs.

       

      Thanks,

      Robert