Hi
I am working with Commerce 12.15, I am trying to set the PreferredBillingAddress/PreferredShippingAddress for a customer. The problem I am facing is that when I try and set an organization address as a PreferredBillingAddress/PreferredShippingAddress, it gives me null. For example:
The code below:
if (ddlMakeThisPrimary == "billing")
{
contact.PreferredBillingAddress = address;
contact.PreferredBillingAddressId = address.AddressId;
}
else if (ddlMakeThisPrimary == "shipping")
{
contact.PreferredShippingAddress = address;
contact.PreferredShippingAddressId = address.AddressId;
}
The lines in bold return a null even though an address is present. This is happening only when I try to assign an orgnization address as a PreferredBillingAddress/PreferredShippingAddress.