I have an issue with setting location value for an Office 365 Business Premium account appointment in OWA.
code for getting location:
function getLocation() {
const $dLoc = $.Deferred();
try {
Office.context.mailbox.item.location.getAsync(function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
$dLoc.resolve(asyncResult.value);
}
else {
$dLoc.reject(translate.getTranslation('ERROR_GETTING_LOCATION'));
}
});
}
catch (e) {
$dLoc.reject(e);
}
return $dLoc.promise();
}
code for setting location:
function applyLocation() {
const $dLoc = $.Deferred();
try {
Office.context.mailbox.item.location.setAsync(_appointmentInfo.loc, function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
$dLoc.resolve();
}
else {
$dLoc.reject(translate.getTranslation('ERROR_SETTING_LOCATION'));
}
});
}
catch (e) {
$dLoc.reject(e);
}
return $dLoc.promise();
}
This works fine on an exchange 2016 on-premise server both in the native Outlook clients(MAC and WIN) and OWA.
In an Office 365 Business Premium account it also works just fine in the Outlook native client , but in OWA (https://outlook.office.com/owa/...) I can get/set the location just fine programmatically, but whatever value I set does not get preserved upon meeting/appointment save/sent.
One difference I notice is that on Exchange 2016 on-premise the location is plain text in the location field in OWA, while in Office365 OWA the location has some html applied to it and it has an X button as in the below image:
Any idea why this happens, why it works for exchange and does not work for Office365 OWA?