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

How to Run Microsoft Flow for Every one Month

Introduction: In this Blog we will see how to Run Microsoft Flow for Every one Month. Implementation Steps:   1. Navigate to  https://make.p...