You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import * as ews from 'ews-javascript-api';
/* ... */
let exch = new ews.ExchangeService(exchVersion)
exch.Url = //...
let folderId = /* folder id of folder somewhere in public folders */
let c = {
GivenName: 'Max',
Surname: 'Mustermann',
EmailAddress: 'max@mustermmann.muster',
HomePhone: '000/1111111',
Street: 'SampleStreet',
City: 'SampleCity',
PostalCode: '12345',
CompanyName: 'SampleCompany'
};
/* ... */
let contact = new ews.Contact(exch);
contact.PhoneNumbers[ews.PhoneNumberKey.HomePhone] = c.HomePhone;
// Specify two email addresses.
contact.EmailAddresses[ews.EmailAddressKey.EmailAddress1] = new ews.EmailAddress(c.EmailAddress);
/* Does not work */
// Email adresses as specified in https://github.com/gautamsi/ews-javascript-api/issues/123
// let email = "new@email.com";
// let emailEntry1 = new ews.EmailAddressEntry('EmailAddress1', new ews.EmailAddress('home', email));
// contact.EmailAddresses._setItem(ews.EmailAddressKey.EmailAddress1, emailEntry1);
contact.GivenName = c.GivenName;
contact.MiddleName = c.MiddleName;
contact.Surname = c.Surname;
contact.CompanyName = c.CompanyName;
/* Does't work */
// Specify two IM addresses.
contact.ImAddresses[ews.ImAddressKey.ImAddress1] = "brianIM1@contoso.com";
contact.ImAddresses[ews.ImAddressKey.ImAddress2] = " brianIM2@contoso.com";
// Specify the home address.
let privateAdress = new ews.PhysicalAddressEntry();
privateAdress.Street = c.Street;
privateAdress.City = c.City;
privateAdress.PostalCode = c.PostalCode;
contact.PhysicalAddresses[ews.PhysicalAddressKey.Home] = privateAdress;
/* ... */
contact.Save(folderId)
Console output
/* ... */
[ComplexProperty.Changed] OnChange events not fired due to circular calling, todo: fix needed
/* ... */
Edit 1:
Emailaddresses etc. are not added to contact.PropertyBag.addedProperties
I am having the same issue. My newly created test contact only holds values for display name and Id. Everything else is either empty or throws exception 'Microsoft.Exchange.WebServices.Data.ServiceObjectPropertyException'.
I'm trying to create a new Contact, but as far as I can tell, only names (GivenName, MiddleName, Surname) and CompanyName are sent to server.
Did I skip any step?
This might be somehow related to:
Underneath is a simplified version of my code
Console output
Edit 1:
Emailaddresses etc. are not added to
contact.PropertyBag.addedProperties
The sent xml is the following:
It looks like there are a few things missing.
The text was updated successfully, but these errors were encountered: