Is there an api to access get all available values async in Office.js, specifically Office.context.mailbox.item in Outlook?
I do not see anything in the docs.
I need to capture 10 or so fields, and to date have only implemented with callbacks, e.g.
var ITEM = Office.context.mailbox.item;
var wrapper = //fn to parse results and call next field getAsync as cb
ITEM.end.getAsync(wrapper);
The documentation reference you have provided stated the Office.context.mailbox.item is the namespace. The namespace don't have the method which would enumerate all other methods in the namespace and return some consolidated result, instead you would use specific method, get the result and move to the next method you are interested in. This is all Office.js API offered for the item.
If you need to get several item properties at once, you may look at EWS request support of Office.js API by calling to Office.context.mailbox.makeEwsRequestAsync. Inside your XML request you may specify fields you are interested in and retrieve them with one request/response. Refer to Call web services from an Outlook add-in article for more information.
Yet another option to get several item properties at once is to Use the Outlook REST APIs from an Outlook add-in
I solved this with jQuery.when
const dStart = $.Deferred()
const dEnd = $.Deferred()
Office.context.mailbox.item.start.getAsync((res) => {
// check for errors and fetch result
dStart.resolve()
})
Office.context.mailbox.item.end.getAsync((res) => {
// check for errors and fetch result
dEnd.resolve()
})
$.when(dStart, dEnd).done(function() {
// will fire when d1 and d2 are both resolved OR rejected
}
If you don't want jQuery you can use promises and Promise.all
Related
we are using EWS Managed API to process items in our exchange public folders. We are able to traverse through folders, retrieve new items and change them. It is possible to Move an item to a specific folder but when we use copy method strange exception occurs: An internal server error occurred. The operation failed., IdAndSession.MailboxSession: session is not IMailboxSession
To exclude a code issue I use an example provided by microsoft:
// As a best practice, limit the properties returned by the Bind method to only those that are required.
PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, EmailMessageSchema.Subject, EmailMessageSchema.ParentFolderId);
// Bind to the existing item by using the ItemId.
// This method call results in a GetItem call to EWS.
EmailMessage originalMessage = EmailMessage.Bind(service, ItemId, propSet);
// Copy the orignal message into another folder in the mailbox and store the returned item.
Item item = originalMessage.Copy("epQ/3AAA=");
// Check that the item was copied by binding to the copied email message
// and retrieving the new ParentFolderId.
// This method call results in a GetItem call to EWS.
EmailMessage copiedMessage = EmailMessage.Bind(service, item.Id, propSet);
Source
But the exception still occurs. Is it possible that this is a bug in Framework?
Thanks in advance for any help.
It is not clear in the current documentation, since the big change on the fetch method. As I understand that in the doc it says:
fetch(context) has been deprecated, instead you can use an anonymous middleware in your page: middleware(context)
So context is no longer available? What is passed into the new fetch method then?
And how do you access the store in the context? For example, prior to 2.12.2, we can use the fetch method as follows:
// pages/index.vue
async fetch ({ store }) {
await store.dispatch('....')
},
So, I assume that the code above will not be working soon in Nuxt 3 in the future. Then how do you fill the store data when you are on a page?
Currently, it seems that you still can access the context as the first argument in the new fetch method. What about in the future?
what is passed into the new fetch method then?
The fetch hook no longer has any arguments.
how do you access the store in the context?
To access the context within the fetch hook, use this.$nuxt.context; and you can access the store like this:
const { store } = this.$nuxt.context
store.dispatch(...)
// or
this.$nuxt.context.store.dispatch(...)
I am trying to use the Closest Facility (CF) function in ArcGIS API for Javascript. I need to be able to pass a shape coming from a feature service as an incident, and use a feature service with multiple points as the facilities.
Currently when I use the Closest Facility task, nothing happens. No calls are made at all if I look at the network activity.
CFTask.solve(CFParams).then(function (solveResult) {
array.forEach(solveResult.routes, function (route, index) {
console.log(route);
});
});
I understand that i may be passing it incorrect data, but would expect an error message, rather than the nothing I get now.
2 questions:
Does the above code snippet actually run the Closest Facility
function?
How do add data from a feature service to a feature set correctly?
First, verify if an error is triggered inside the promise when you run the code snippet by using catch method:
CFTask.solve(CFParams).then(function (solveResult) {
solveResult.routes.forEach(function(route, index) {
console.log(route);
});
}).catch(console.error);
If you see an error message printed in the console, add it to your question.
Also there is a syntax error in your forEach function
We have programmed in android to track omniture using page name using the code
Analytics.trackState(pageName, params);
The params contains lot if data like s.channel, s.prop, Prop, s.eVar
Now: We want get all the params which got recorded in omniture by hitting this link
I am trying to use the nomniture module to call Report, but it is very difficult to understand the parameters to choose a particular page
My Node.js Code
var Client = require('omniture').Client, c = new Client(username,
sharedSecret, 'sanJose'), reportData = {
"rsid_list" : [ reportSuiteId ]
}
How to use s.pageName in a request to retrieve the recorded variables for a particular custom page name
I tried to use Report.QueueTrended, Report.QueueOvertime, Report.QueueRanked followed by Report.Get but I am not getting anything
I always ended up getting errorCode 5003, The report may contain imcomplete data. Please try again later
I'm working in Silverlight 5 and am trying to write an autocomplete textbox (I'm using the telerik radwatermarktextbox control with a radcombobox to show the items) whose list of items is a list of airports returned from an async call to a WCF service.
The issue that I'm running into is that if I'm typing quickly in the textbox, multiple async calls to get the filtered list of items are kicked off (one for each keypress) and they dont necessarily finish in the same order as they were run - particularly when the list coming back is large.
So if I were to type HPN really quickly, the following calls get kicked off
Async call with H as parameter (#1 - will return 231 rows)
Async call with HP as parameter (#2 - will return 4 rows)
Async call with HPN as parameter (#3 - will rrturn 1 row)
sometimes I'm getting the results to call #1 after the others
I cant change the wcf service I'm calling or add a synchronous method to the WCF service.
Foxpro has a function called CHRSAW which can tell you if there are keys waiting in the input buffer (http://msdn.microsoft.com/en-us/library/5skwdb75(v=vs.80).aspx) which could be used to prevent calls #1 and #2 from being called.
Is there an equivalent .NET function/ality that would allow me to do this?
Here's the code I'm using
private void ICAO_TextChanged(object sender, TextChangedEventArgs e)
{
TextBox txt = (TextBox)sender;
if (txt.Text != String.Empty)
{
radBusyIndicator1.IsBusy = true;
_ServiceClient.FindAirportByPartialICAOAsync(txt.Text.Trim().ToUpper());
}
}
An even easier solution than the one you posted in the comments is to post the text you are sending as the parameter as the user state as well. So when looking for "H" you would pass "H" as the user state.
When the calls come back just only use the one where the user state = the text in the autocomplete.