0

I am saving the outlook context and in the saveAsync method i am getting event Id. Sometimes event id contains '/' in it. if i use that eventId with '/' it is failing. can someone help me on this?

Office.context.mailbox.subject.setAsync
(
    "subject",
    function (asyncResult0)
    {
        if (asyncResult0.status === Office.AsyncResultStatus.Succeeded)
        {
            Office.context.mailbox.body.setAsync
            (
                "sample body",
                function (asyncResult1)
                {
                    if (asyncResult1.status === Office.AsyncResultStatus.Succeeded)
                    {
                        Office.context.mailbox.item.saveAsync
                        (
                            function (result)
                            {
                                **let eventId = result.value;**
                                // Process the result
                            }
                        );
                    }
                }
            );
        }
    }
);```
vinay narayana
  • 197
  • 1
  • 2
  • 10
  • Which client are you using? Are you using the rich desktop Outlook client on Windows, or on a Mac, or the web client in a browser? – Outlook Add-ins Team - MSFT May 16 '19 at 10:30
  • I am using both outlook client for mac and web client in browser. Both places i am having same problem. Getting the same issue in both the urls (https://office.com) and (https://outlook.live.com) – vinay narayana May 20 '19 at 10:20

1 Answers1

0

Update your code to:

Office.context.mailbox.subject.setAsync -> Office.context.mailbox.item.subject.setAsync
Office.context.mailbox.body.setAsync -> Office.context.mailbox.item.body.setAsync

If the problem persists, could you please share the screenshot of the result and the scenario you're trying to achieve.

  • I am using mailbox.item.* only in all the cases. Following is the scenario 1. I am opening the create appointment page. 2. I have a outlook app the that can be opened in create appointment page. 3. In my app i am taking the current opened event context and adding subject, body and date from my outlook app. 4. After adding them as said above i am saving the context and getting the event Id. 5. That Event id is having '/' in it. – vinay narayana May 21 '19 at 09:07
  • Sample eventId: **AAMkADhlZWUwODk5LTRjYzUtNGJmYS04ZmI1LTJjODZhYjk4NTQ4MgBGAAAAAACWpHn1gAk8QZlKl+Tmw8nRBwCQIg4qnVjqQqK7/HpL22vUAAAAAAENAACQIg4qnVjqQqK7/HpL22vUAAD3yUlhAAA=** – vinay narayana May 21 '19 at 09:08
  • Vinay are you referring to '/' in sub-string 'qQqK7/HpL' if so, eventId is correct. If you want to make a REST Call using this value please refer to Office.context.mailbox.convertToRestId. – Outlook Add-ins Team - MSFT May 22 '19 at 05:48