Outlook Add-in : Not getting Outlook Addin RoamingSettings on OWA after saving the same in Outlook Client - outlook-web-addins

I am building an outlook-addin which saves the data in the RoamingSettings.
Using the code :
Office.context.roamingSettings.set('key1', 'AmIABug');
Once I save it in RoamingSettings my assumption is that when I open an email on the OutlookWebApp. It will immediately pull that save value when I request for it.
Office.context.roamingSettings.get('key1');
However this is not the case.
First, considering that there is an issue with RoamingSettings : Pointed out here.
Why Outlook's RoamingSettings object initialized with old values after page re-load/ redirect?
Which I was able to overcome with the work around mentioned:
https://github.com/joeparzel/RoamingFix
which seemed to work properly on the Outlook client, however Now. I am using the OutlookWebApp and what I see is that even when I have the OutlookWebApp already open I do not see the new RoamingSettings values when requested even when I close the TaskPane on one email and open the same using another email.
If I refresh the page I get the expected output. Can someone please tell me if RoamingSetting for OWA is only set once when the page loads, unlike the thick client where if I reopen my task pane, it gets the latest values.
In may have I missed something silly, please help.

This is the expected behavior. OWA only loads RoamingSettings once which is why when you reload the page you get the new values. Also note that since you are using a thick client to set the properties and the thick client by default runs in cached mode, there may be cases where you might not get the properties back on owa even after reload for some time since the properties haven't been synced back to exchange from thick client yet. Once thick client's sync kicks in, you should be able to see the props in OWA after a reload.

Related

SharePoint Embed web part re-writing my URL

SharePoint Online: Until yesterday, I was able to use the standard Embed web part to display an iFrame to my SSRS Report server that included the control settings in the URL to hide toolbar, etc.
Like this:
<iframe src="https://reports.mydomain.com/ReportServer?/Reports/WallChart_GP&rs:Command=Render&rc:Toolbar=false&rs:ClearSession=true" height="400" width="300"></iframe>
Today, that is suddenly resulting in "Reporting Server Error: The operation you are attempting on item '/' is not allowed for this item type. (rsWrongItemType)". However if I put the URL directly into a browser I get the correct result... report with no toolbar.
When I switch the SharePoint page to edit mode and look at the Embed web part, I see that it's changing my & to & plus "amp;" for HTML formatting. If I paste that modified string into a separate browser I do still reach the report but the server ignores at least some of my commands in that I then see the report server toolbar despite setting it to false. So I don't know if it's always changed my URL like that, or if that is indeed the source of my problem. But I had not even re-published my pages in SharePoint.
If I put an embed string in the SharePoint web part that does not attempt these report server commands, I do get the report as desired. For example this displays my report in the SharePoint web part (but with the toolbar that I'm trying to avoid showing):
<iframe src="https://reports.mydomain.com/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fWallChart_GP" height="400" width="300"></iframe>
The thing that has me bring this here is the fact that it was working up until yesterday. Nothing was changed on either end. I suppose Microsoft Support may be the correct avenue but I'm concerned that I will just be told that I can't do it without regard to the fact that it worked all along.
Any insight into why this is now different or what I can do to resolve the problem?

Gmail - Link to Draft in non-conversation view

I am importing/creating drafts in Gmail using the Gmail API. After creation I'd like to redirect the user to the Gmail UI with the opened Draft in the composer window.
I made it work properly for https://mail.google.com/mail/#drafts?compose=[MESSAGE ID]. Other urls I found here also worked well. Gmail is doing some redirects and eventually the composer window is opened with the draft.
Now my issue:
If the user has not enabled "Conversation view" this will not work at all. The redirect will then result in https://mail.google.com/mail/u/0/#drafts?compose=new and only an empty, new composer window is shown and a new draft is created by the UI.
If I open the draft directly the ID-format is different. https://mail.google.com/mail/u/0/#drafts?compose=hJzgZpSqgLQcCWgZqnlNRzRBfMbjZVnZklzvcFxhQCdwT... and I have no idea if this format can be generated somehow.
Does anybody has an idea or experience to also make it work with this UI setting. How I can force Gmail to load the draft into the composer window?
Thanks in advance.
If you have Email Threading > Conversation View enabled
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox?compose=DRAFT_MESSAGE_ID
If you have disabled the Email Threading > Conversation View option
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
Additional information
The main difference between them is that the first is treated as a conversation while the second example is not.
You can use #drafts instead of #inbox in the URL.
The number after .../mail/u/ is the session you have opened
You can retrieve the DRAFT_MESSAGE_ID by making a request to the API
You can approximately generate the compose ID by yourself, there are some examples out there (not recommended). I strongly recommend you to use the DRAFT_MESSAGE_ID instead.
This appears to still be an issue the one solution I did find was that you can find your draft directly (even though it would be the last draft) and go through multiple accounts by redirecting to
https://accounts.google.com/AccountChooser?authuser={user account}&Email={email account}&continue=https://mail.google.com/mail/#search/rfc822msgid:CAMU-31NcJCVHyGNsAycRKfuS0nMonoaZ6wFMD90Sej996qjuPQ#mail.gmail.com
You need to get your message id toi replace the area from <> from your draft. So you'll have to create the draft first. Get the google message ID, then use that with messages/get to get the Global Message Id (also referred to as message id) and then use that with a search. At this point you'll open a page with a search to a single draft but it will not be opened. Your users will have to click on the one message. Unfortunately there does not seem to be a way to have the good way work for conversation view, and this way work for non.
I tried many different URLS and nothing worked. As noted in the original question, it might work that you could link to the full URL but I see no way to get that. If you spend long enough working with an email you'll even find that ID changes so they aren't even stable within a single day.
Another solution that could work is as explained:
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
But as noted this does not open the draft on the first time you go there. It seems you have to travel to that link 2 times in a row to get the message to appear. I guess you could go to the page maybe inject some javascript to go to the page again but I don't know how to do that.

Excel Hyperlink adding redirectURL

I'm creating a hyperlink in excel
=HYPERLINK("https://www.redacted.com/index.html?Display=GroupMeetings/index","link")
When I click on this link it changes the Url to
https://www.redacted.com/index.html?redirectURL=Display%3DGroupMeetings%2Findex
if I change the URL to have ?Displayy= with two y's it does not add the redirectURL attribute. I cannot find any documentation about why this is added. Anyone know why?
The end goal is to deep launch users to specific pages within the application via a hyperlink in excel.
Do the users need to be authenticated to view the pages you are sending them to?
If so the cause may be this (taken from this answer on super user https://superuser.com/a/445431/154198):
Clicking a URL in Excel seems to open it in your default browser. But that's not really true. Before opening it in your browser, Excel first runs Microsoft Office Protocol Discovery. This uses a Windows/Internet Explorer component to determine if the URL works. (It does not identify itself as Internet Explorer, but as "User Agent: Microsoft Office Existence Discovery".) And if the results are (somehow) okay then it will open the result of that check in your default browser.
Microsoft have issued a fix for this KB218153 - which can be found here:https://support.microsoft.com/en-gb/help/218153/error-message-when-clicking-hyperlink-in-office-cannot-locate-the-inte
This may not be your specific problem, but it is at least worth knowing about.

Restrict user from closing outlook mail app, while some action is in progress

I am working on an Outlook mail app, which will be available to user on web only (not of outlook desktop).
A file need to be uploaded from app to azure via custom control in compose form of App, meanwhile the file is uploaded to Azure user should not be able to close the mail. If they try to do so, a warning should be given to them.
Adding to #Slava's answer, I would suggest using addAsync API for notification messages. You can add a notification of type progress indicator until your task is complete and replace it with a notification of type informational message.
Click here for reference
Unfortunately Office.js API does not have the feature you are inquiring. You will not be able to disallow user interaction, as such closing the compose window or closing your add-in. As the API doesn't have "OnSend" or "OnClose" events you will not be able to display any warning either. If this is the new feature you would like to add you may try to send request via Office Developers User Voice.
As the work around you should clearly indicate for the users that they need to wait and do not interup operation. You should display activity indicator, indeed. And finally you should be prepare user still interupt the operation in the middle and work properly with the error occur.
Hope this helps.

Excel links to JIRA issues forcing re-authentication

Situation
Attempting to launch a JIRA issue hyperlink from Excel 2013 drives the user to a login page for JIRA which is unexpected as the user has an active login session.
Example link format --> https://<subdomain>.atlassian.net/browse/<proj-#>
Even if the user logs in the first time, checks the box for "Keep me logged in" the user still must repeat this the next time a JIRA link from Excel is selected.
The URL appends the parameter &permission-violation=true
Attempts to Debug
Copy the link to clipboard and paste directly in browser URL bar. This method does not generate the permission violation. User can go directly to issue without logging in again.
Attempt the link in a different Office 2013 application. Using the same link from a MS Outlook 2013 email does not generate the permission violation.
Browse the JIRA administration page for solutions. Could not find any such option to configure.
Tested with both Firefox and Chrome set as the default browser. Issue persists for each.
Any suggestions to fix this? The behavior is very frustrating to our end users.
The Problem
According to StackOverflow user myroslav, certain versions of Excel are first attempting to fetch the webpage using a Microsoft DLL that does not know about your browser's cookies (i.e. your login session). Here's an excerpt of his answer:
If session cookie protects website Hlink naturally is being redirected
to login page and having reached HTML page and not able to
"understand" it opens it in external browser. Note that it opens not
original URL (expected behavior) but the result of redirect, even if
it was 302 redirect.
His full answer can be read here.
The Solution
At this time, Microsoft has recommended that companies with single sign-on sites like Atlassian's should address the issue on their end. Such a fix is low on Atlassian's priority list. In the meantime, we are left to either accept Microsoft's solution - modify the registry as myroslav instructs and accept a loss of Excel functionality - or modify our URL to something that doesn't require single sign-on user validation.
The Workaround
I'm using Excel 2016 and Chrome. Taliesin's workaround, elsewhere on this page, did not work for me, but might work for some. Here's a next-best-thing workaround that did work:
HYPERLINK("https://<subdomain>.atlassian.net/issues/?jql=id%20in%20("&<cell>&")", "link")
Replace <subdomain> with your Atlassian subdomain, and <cell> with the cell containing your JIRA issue key.
This URL variant opens a search query for issues matching the given key. It doesn't take you directly to the issue, but it at least offers a convenient link to get where you want to go, which is at least better than entering your credentials on the login page again.
Try restarting the browser and login to JIRA by selecting keep me signed in
It seems to resolve the issue: https://www.redmine.org/boards/1/topics/14287?r=40540
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\"YOUR OFFICE VERSION"\Common\Internet]
"ForceShellExecute"=dword:00000001
Workaround
Ok. So I have discovered a workaround. Note this will correct the issue in an indirect way by leveraging JIRA's own link correction behavior. Essentially, you can bypass the security issue by providing JIRA with an incorrectly structured URL. JIRA will then fix the URL and redirect you to the correct page.
Here is the structure https://<subdomain>.atlassian.net/browse/<proj-#> + /
Note the last forward slash. This does not belong in the URL construction but when used will establish the redirect and thereby bypass the security violation.
If you already have your hyperlinks in a JIRA file you can easily update those in batch by using this simple VBA code subroutine.
Sub AppendJiraLinks()
Dim c As Range
Dim i As Integer
For Each c In Selection.Cells
If c.Hyperlinks.Count >= 1 Then
For i = 1 To c.Hyperlinks.Count
c.Hyperlinks(i).Address = c.Hyperlinks(i).Address & "/"
Next i
End If
Next c
End Sub
Note this code could be enhanced but works fine for my purposes.

Resources