London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Order addresses are useful when you manage address data retrieved from Customer Management and Order Management, since they use different models for storing data: one uses Meta Data Plus, and the other uses Business Foundation (BF).
Classes in this topic are available in the following namespaces:
* Metaclass from Meta Data Plus; ** BF class
Example: retrieving a customer's preferred shipping address
CustomerContact contact = CustomerContext.Current.GetContactForUser(SecurityContext.Current.CurrentUser);
CustomerProfileWrapper customerProfile = SecurityContext.Current.CurrentUserProfile as CustomerProfileWrapper;
IEnumerable addresses = contact.ContactAddresses;
foreach (CustomerAddress ca in addresses)
{
if (ca.Name == customerProfile.PreferredShippingAddress)
{
//we have the preferred shipping address
}
}
Example: retrieving a shipping address
string shippingAddressName = cart.OrderForms[0].Shipments[0].ShippingAddressId;OrderAddressCollection addresses = cart.OrderAddresses;
foreach (OrderAddress oa in addresses)
{
if (oa.Name == shippingAddressName)
{
//we have found the shipping address
}
}
Last updated: Oct 12, 2015