Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
customerContact.PreferredBillingAddressId = null; customerContact.PreferredShippingAddressId = null;
Thanks Mark. I had tried that and it threw a foreign key exception, but the reason was that I was traversing through all the contact addresses and deleting them as well. Once I split it up, it worked:
customerContact.PreferredBillingAddressId = null; customerContact.PreferredShippingAddressId = null; customerContact.SaveChanges(); foreach (var customerAddress in customerContact.ContactAddresses) { customerContact.DeleteContactAddress(customerAddress); } customerContact.SaveChanges();
Thanks
Frederik
In the past I've been able to just do something like this:
But now when trying to set PreferredBillingAddress = null I get NullReferenceException (this happens before calling SaveChanges().
What's the recommended way to remove/reset the PreferredBillingAddress and PreferredShippingAddress? The site is running Episerver Commerce 10.8.0.