Error while executing async get of Outlook item property

622 views Asked by At

Why am I getting Could not complete the operation due to error 80043200 sometimes while getting Outlook item property (for example, Subject) in email Compose mode?

Call stack:

Error
   at n.prototype.execute (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:86635)
   at u.DDA.OutlookAppOm.prototype.callOutlookDispatcher (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:150300)
   at u.DDA.OutlookAppOm.prototype.invokeHostMethod (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:150169)
   at u.DDA.OutlookAppOm.prototype._standardInvokeHostMethod$i$0 (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:148443)
   at r.ComposeSubject.prototype.getAsync (appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.02.js:11:190544)

We use following code for getting a field from an Outlook item:

sfMailApp.OfficeManager.prototype._reloadField = function (name, defaultValue) {
var deferred = $.Deferred();
defaultValue = defaultValue || '';

var item = this.getItem();

if (item.isFake) {
    deferred.resolve('');
    return deferred.promise();
}

var field = item[name];
if (field && this._isComposeMode && field.getAsync) {
    var _this = this;
    try {
        field.getAsync(function (result) {
            if (result.status === Office.AsyncResultStatus.Succeeded) {
                _this[name] = _this._processOfficeData(result.value) || defaultValue;
                deferred.resolve(_this[name]);
            }
            else {
                _this._onError(result);
                deferred.reject();
            }
        });
    } catch (e) {
        deferred.reject();
    }
} else {
    this[name] = this._processOfficeData(field) || defaultValue;
    deferred.resolve(this[name]);
}

return deferred.promise();}

Code for getItem function:

sfMailApp.OfficeManager.prototype.getItem = function () {
var item = Office && Office.context && Office.context.mailbox && Office.context.mailbox.item ? Office.context.mailbox.item : null;

if (!item) {
    item = {
        isFake: true
    }
}

return item;}

One more error we're getting sometimes while trying to get user identity token:

{"name":"AccessRestricted","message":"Internal protocol error: -2147467259'.","code":9017 }

How should we handle that?

0

There are 0 answers