Get the Duration an Outlook Email was Composed for - node.js

I've looked at the Message (email) class in the Office 365 API Resource Reference, as well as the other classes and various Office 365 docs, but there doesn't seem to be an elegant method for obtaining the duration a user spent composing an email. I'm very surprised that the Message class does not have a "ComposedTime" attribute or something along those lines, for emails in the SentItems (Sent) folder.
My current implementation is very brute-force, I am hoping there is a more straightforward implementation, thank you!

The back end doesn't track that, so no, there is no property for it. You can always suggest it on UserVoice.

Related

How does a Gmail message Id or ThreadId map to the new Gmail UI?

Edit: addressing the first comment below and for clarity, this isn't a code question. The question is simply:
What do I put into the URI querystring of the new Gmail UI to view a draft message created by the Gmail API?
Despite this not really being a code question, I'm asking on Stack Overflow as it's Google's preferred platform for Gmail API questions.
--
If I view a draft message in the new Gmail UI, the URI is something like this:
https://mail.google.com/mail/u/1/?zx=iij9apqgzdf4#drafts?compose=jrjtXSqXwlFGnSGCQgDCdnHGVFdlpFMgzsCNgpQstQLxdLCMkjKstBmWZkCmjhWTQnpsZCJF
I can't see any way to create such a link from the Id or ThreadId of a message created via the Gmail API.
Previously, one could do this:
https://mail.google.com/mail/u/1/?zx=ov61dxfbrcga#drafts?compose=1631caae9dbb074d
where the value of "compose" is the Id.
How can the same thing be accomplished in the new UI?
I've been encountering the same problem and have had some success in this problem, as well as some issues I still can't get past.
Good news: The new compose parameter format is some kind of "base40" encoding. I searched the Gmail source for a restricted alphabet string, and found and deobfuscated the bit of code doing this encoding/decoding: https://gist.github.com/danrouse/52212f0de2fbfe33cfc56583f20ccb74
This code includes an encode and decode function which should work for Gmail-format query parameters.
Bad news: The values that it is encoding to open draft emails do not appear to be available using the Gmail API. Specifically, they look like this:
thread-f:NEW_THREAD_ID+msg-a:DRAFT_ID -- while the draft ID is the same as it was before, the Thread ID does not appear to match any of the IDs that the Gmail API returns.
Interestingly, if you inspect the subject row in the Gmail UI, it has dataset attributes including all of both the old format and new format IDs - but it's still unclear how to get the new ones programatically.
Thanks to #frank-szilinski - he pointed out that the old format is now translated. I.e. this now works again:
https://mail.google.com/mail/ca/u/1/#drafts/1661237c4db71ace
It doesn't seem to work when the Gmail tab isn't already open, however.
Building on #kremonte gist, and #chris-wood comments, I made a rails gem that correctly creates the open-the-draft-inside-gmail URL.
It's here - https://github.com/GoodMeasuresLLC/gmail_compose_encoder
It's for the use case of "my code created a draft (prepopulated with some text, of course) and now I want to open the draft in compose mode so that my user can review it before hitting "send".
How to get the URL for a draft
If, for example you use a list request from which you get your draft objects:
{
"id": string,
"message": {
object (Message)
}
}
You can take this id and put it into a URL in this format:
mail.google.com/mail/#inbox?compose=[id]
Eg.
mail.google.com/mail/#inbox?compose=3doinm3d08932d
This will open up GMail with the relevant draft open.
I was struggling because I wanted it to work with multiple accounts. However the authuser parameter did not help.
Inserting the email address instead of the integer after the u/ component solved the problem.
https://mail.google.com/mail/u/{email_address}/#drafts?compose={message_id}
The message id is the one provided by the API.

How can I set the shipcarrier to More on a sales order using SuiteScript in a RESTlet?

SuiteScript v1, but I'll switch to SS v2 if it's the only way to make it work.
I've tried:
salesOrder.setFieldText('shipcarrier', 'More');
salesOrder.setFieldValue('shipcarrier', 'noups');
salesOrder.setFieldValue('shipcarrier', 'nonups');
But UPS is always selected once the record is saved.
shipcarrier is a bit of an odd thing.
I'm not sure it is actually sticky - in some contexts it appears to be and in some it doesn't.
It appears to be pointless to set unless you are also setting shipmethod.
salesOrder.setFieldValue('shipcarrier', ffShipCarrier); //'ups' || 'nonups'
salesOrder.setFieldValue('shipmethod', ffShipMethod)
PS from cja: My conclusion/solution: Setting shipmode does nothing unless recordmode is dynamic and shipmethod is set at the same time. If both those conditions are met then the value shipmode will be updated.
NetSuite support have warned me against using this solution:
"With regards to your concern, I am able to set the Ship carrier field on the Sales Order record in the client script(nlapiSetFieldValue('shipcarrier', 'ups');) however I was unable to set the value of the field in the server side script. Upon further investigation, the field (ship carrier) isn't exposed in the Record browser hence the field isn't officially exposed for scripting needs. Please refer to the following Suiteanswer article for your reference.
"I am really glad that the solution worked for you perfectly. In order to explain further, I would say it is not advisable to write scripts using unexposed fields in the record browser. It may change in the future without any prior notification and can cause problem and NetSuite will not hold any kind of responsibility for the same.
"User groups contains simple solution to complex tips and tricks provided by the experienced customers. On the other hand, NetSuite Support are stickly adhering to the official documentation/processes to assist any of its customer. The solutions provided in the User groups are totally upto the consent of the customers and can be implemented at their own risk if not confirmed in the official documentation or NetSuite Support."
You need to use setFieldValue and pass the internal id of the "More" ship carrier.
nlapiSubmitField('salesorder', recordid, 'shipcarrier', 'nonups');

Sharepoint Attendees without a Workspace for Calendar Event

I am wondering if it is possible to have a custom form in Sharepoint 2010 where I am able to add/edit a calendar event and access the attendees list that is normally visible on the workspace page.
I assume that perhaps I need to at least hard code a workspace to be selected as I believe attendees need to be assigned to a workspace.
Open to suggestions as I'm new to Sharepoint but seems crazy having to create or link to a workplace for each event.
Greatly appreciate any help.
#WashBurn not sure if this what you are looking for. Goto your calendar - list settings. goto the "Content Types" section. click the content type...should be event. from there click "Add from existing site content types " and attendees should be in there. hope that helps!
There is a simple (unfortunately not intuitive) way to achieve what you are trying to do.
click on list settings for your calendar list. You will see about half way down a section called content types.
![enter image description here][1]
Click on the event content type (which should be there by default.
this takes you to another similar screen where you can simply add the attendees column.
Once you know that attendees are part of an event it is then intuitive.
Hope this helps.
This is one of many nasty little things that come up when you try to build your meeting management on SharePoint. Other very common problems include integration with any e-mail client, first of all Outlook but not only, sending meeting requests from SharePoint and handling the respoded attendee's status...
The SharePoint calendar e-mail extension is a third party solution that might solve your problem.
Here is the link: http://www.sapiens.at/en/products/pages/sharepoint-calendar-e-mail-extension-3.0.aspx
Every SharePoint list (wether it's document library, calendar, lnks or custom list) have both a Create Form, Edit Form and a Delete Form. Each of which you through SharePoint designer can create your own custom versions of, in your case, this is needed to edit a Calendar List item with its associates/attachments.
Read one of Microsoft's own guides on how, here
Although this is a very old post, i just ran into the same issue and figured out a way to solve this issue.
Simply go into the Content Type 'Event' and add the Column 'Attendees' :)
Then you can also use the attendees as input for a workflow, e.g. to notify them on Event creation/update. i attached two Screenshots to show how you can do that using SharePoint designer!
With this phrase you can add the Link to the Event into the Mail Body:
[%Workflow Context:Current Item URL%]
Hope that helps other people in the future.
I believe I have the solution we are all looking for.
Create a standard event calendar (the one that does not have attendees)
Add the 'Schedule and Reservations' content type to the calendar from the list settings page
Modify the 'Calendar' view so the filters read
attendees is equal to me
OR
attendees is equal to
The second entry is completely empty but allows SP to match for no attendees
You can add more columns with OR statements if you need to be sorting based on additional groups
This worked for my needs, hope it works for everyone else

SharePoint 2010 Basic Workflow Question

I've just started to look workflows in 2010 which seem pretty good but I can't find seem to find out how do something very simple.
Basically I'm creating a lost property list and workflow, essentially anyone can add a new item to the list for an item that they've found. Next anyone can make a claim on an item in the list which should then email the admins where they can investigate and close claim if the rightful owner has claimed their item.
Should be very simple and would take me no time in .net but not in SharePoint! Any suggestions on how I could do this?
I've been looking at SPD workflow tasks and not really getting anywhere. My next step is to go into VS2010 but this seems overkill for such an easy task.
Thanks
Dan
what is your intention to allow someone to "claim?" are you intending to enable a "claim" as just a flag and a workflow sending emails to the admins?
Create a Yes/No field Claimed with the default value set to false.
Create a SPD Workflow that would start OnItem Create.
In this workflow add an Action that waits till the Claimed Flag is set to true.
Then you can send the email to the administrator (also with an SPD activity).
Optionally you can delete this item from the list after a period of time.
Based on my understanding of your question and the fact that we tried something similar a while back, I have created a blog (my first blog entry!). Below is the link, feel free to leave comments;
http://sp10tech.blogspot.com/2010/10/creating-simple-workflow-using.html
Alternate Idea;
Maybe use two lists. One for items lost and one for claims. This way you can have multiple claims on each lost item. Add a field that references the claims list so the user can select it. Then simply have the administrators use a out of the box alert mechanism. No need for elaborate work flow.

Get Sharepoint store URL in Outlook?

I'm trying to write an Outlook 2007 VSTO add-in that lets you do some stuff with Sharepoint webservices. I'd really like to make it as simple as possible for the users; ideally, all that they would have to do is connect a Sharepoint list to Outlook. From there, my add-in would ideally grab the actual Sharepoint URL from the list and do its thing. Unfortunately, I can't seem to find where Outlook stores this information while running.
The best solution I've been able to find is to read in the files found in C:\Documents and Settings(username)\Local Settings\Application Data\Microsoft\Outlook*.sharing.xml.obi.
However, these files are only updated when you close Outlook. That means that the user would have to connect to the list, restart Outlook, and then things would work. I'd rather not have things get to that level.
It's almost like the information just magics its way into the sharing.xml.obi files. I've Googled, I've used OutlookSpy and in desperation I've used mfcmapi.exe, all to no avail. Where the heck does Outlook store this?
You can use the object model (or direct MAPI calls) to query this information from the outlook folder. First use the .isSharePointFolder property to locate your folder. The URL of the SharePoint List in outlook is then stored as the subject of a "hidden" message in the associated contents table.
Bonus tip: If you are not using it already, get yourself a copy of the excellent OutlookSpy. It makes figuring this kind of stuff out so much easier.
With Paul-Jan's pointer, I've figured this out. Since I hate it when I only find indirect hints while googling, here's exactly the code you need:
private string getSharepointURL(Microsoft.Office.Interop.Outlook.Folder SharepointFolder)
{
if (!SharepointFolder.IsSharePointFolder)
throw new Exception("Cannot get the SharePoint URL of " + SharepointFolder.FullFolderPath + ", because it is not a SharePoint folder.");
return (string)((object[])SharepointFolder.GetTable("", 1).FindRow("[From] = SharePoint").GetValues())[1];
}
That may be the ugliest return statement I've ever written. Here's what it does:
Calls Outlook.Folder.GetTable("",1). The first argument is a filter, which means "anything", and the second argument is equivalent to olHiddenItems. (I couldn't find the actual enumeration)
Gets the next row of that table whose sender (the [From] field) is "SharePoint". The information we want is always held in this hidden message.
Gets the values of that hidden message. This comes back as an object, but is secretly an object[].
Casts the values to an object[].
Gets the second item of the values, which is the url.
Casts the url to a string.
Fortunately, you can do all these steps yourself in OutlookSpy. That was a real help in figuring out how to get at this precious nugget of information.
Well, here is what I use... (C#3/VS2008, Outlook2007)
Outlook.Folder folder = GetSomeSpFolder(); // requirement :)
// Things to look for here, not in the columns by default
// the values can be found in OutlookSpy or perhaps MSDN (haha)
// this value refers to the SP site (not the full URL)
var SHARING_REMOTE_STORE_UID = "http://schemas.microsoft.com/mapi/id/{00062040-0000-0000-C000-000000000046}/8A48001E";
var table = folder.GetTable("[From] = SharePoint", Outlook.OlTableContents.olHiddenItems);
// setup columns to look through
table.Columns.RemoveAll();
table.Columns.Add(SHARING_REMOTE_STORE_UID);
if (!table.EndOfTable) {
var row = table.GetNextRow();
var siteURL = row[SHARING_REMOTE_STORE_UID];
Marshal.ReleaseComObject(row);
} else {
// No matching entry ...
}
Marshal.ReleaseComObject(table);
Also check out http://msdn.microsoft.com/en-us/library/bb176406.aspx
Happy coding!

Resources