Friday, March 4, 2016

User belongs to Different Business Unit than a Role

Hi,
Today I got a scenario to create a User and assign Security Role to a User.
While associating Role to the Team am getting following error
“User belongs to Different Business Unit than a Role”

Resolution:

After creating user check the Business Unit of the User and Pass the Business Unit to the Query Expression and the Result of Role associate to the User

QueryExpression role = new QueryExpression("role") { ColumnSet = new ColumnSet(true) };
                    role.Criteria.AddCondition(new ConditionExpression("name", ConditionOperator.Equal, "Activity Feeds"));
                    role.Criteria.AddCondition(new ConditionExpression("businessunitid", ConditionOperator.Equal, businessunitid));
                    EntityCollection roleActivity = orgService.RetrieveMultiple(role);


No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...