How Can I retrieve CustomerRole by customerID?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Please How Can I retrieve CustomerRole or CustomerRoleID by customerID?
I am trying to retrieve a currently selected customerRole programatically and store it. I can locate the customerId from the querystring when I click on the customer, just need to find the customerRole.
Please if anyone knows, please help me out here. thanx
13 years ago
Try the following code
var customerRoles = CustomerService.GetCustomerRolesByCustomerId(customerId)
13 years ago
a.m. wrote:
Try the following code
var customerRoles = CustomerService.GetCustomerRolesByCustomerId(customerId)


Couldnt use the code u gave me so I had to initialize CustomerService like

CustomerService cs = null;
        var roles = cs.GetCustomerRolesByCustomerId(customerID);

But I was getting an error: Object reference not set to an instance of an object.

Please a.m.  What else can I do. thanx for your help.
13 years ago
Try the following code:
var customerRoles = IoC.Resolve<ICustomerService>().GetCustomerRolesByCustomerId(customerId)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.