Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
This topic describes the Customer Management system, a central component that lets you add individual organizations, contacts, and Commerce Manager users. From Customer Management, you also can create purchase orders for each customer account.
The following image describes Customer Management and the relationship between the various objects. You can create different types of relationships between Business Foundation (BF) objects, see Meta-class references.
Definitions:
Classes in this topic are available in the following namespaces:
Customer groups target multiple Customers and Organizations for pricing and promotions. Both the Customer and the Organization expose their own CustomerGroup information, and the Customer has a derived property, called EffectiveCustomerGroup, that combines the two with the priority on the Organization value. See Customer Groups.
EffectiveCustomerGroup is used in pricing and promotions instead of the regular CustomerGroup. The EffectiveCustomerGroup returns the CustomerGroup of the parent Organization, if the CustomerContact belongs to a parent Organization that belongs to a CustomerGroup, or its own otherwise.
Use EntityObject to access the child organizations of an organization, a core BF object. The EntityObject is an important base class for CustomerContact, Organization, and any custom business objects you create. EntityObject has only a PrimaryKeyId property to retrieve the full organization object from the CustomerContext singleton.
Example: retrieving organization object
List<Organization> PartnerOrganizations = new List<Organization>();
foreach (object child in PartnerOrganization.GetChildren())
{
EntityObject obj = child as EntityObject;
Organization org = CustomerContext.Current.GetOrganizationById(obj.PrimaryKeyId.Value);
if (org != null)
{
PartnerOrganizations.Add(org);
}
}
Note: The permissions infrastructure allows for more complex permission management. However, work is required to implement a custom security system with roles, permission hierarchies, and logic.
Example: Using SecurityContext methods
// Allows you to check whether a user is in a role.
// CheckUserInAnyGlobalRoles()
// "GlobalRoles" really just means any role (built-in or custom).
if (!SecurityContext.Current.CheckUserInGlobalRole(SecurityContext.Current.CurrentUser, "Asset Viewers"))
{
// Add your logic here for handling insufficient permissions.
}
// Allows you to check whether the current user is in a role.
// CheckCurrentUserInAnyGlobalRoles()
List<SecurityRole> secure = new List<SecurityRole>();
secure.Add(new SecurityRole("Asset Viewers"));
if (!SecurityContext.Current.CheckCurrentUserInAnyGlobalRoles(secure))
{
// Add your logic here for handling insufficient permissions.
}
Last updated: Oct 12, 2015