There was a strange issue in CRM 2011 where the security roles of users part of a BU get removed when the BU’s parent BU is changed. This issue seems like fixed by Microsoft in CRM 2013 RU2 and we do not see that issue in CRM 2015 either.

 

If you are still using CRM 2011 and are affected with this issue, a work around would be to reassign the security roles through custom code or from UI after the parent BU change.

Through Code:

<pre>// Associate the user with the role.
        if (_roleId != Guid.Empty && _userId != Guid.Empty)
        {
            _serviceProxy.Associate(
                        "systemuser",
                        _userId,
                        new Relationship("systemuserroles_association"),
                        new EntityReferenceCollection() { new EntityReference(Role.EntityLogicalName, _roleId) });

            Console.WriteLine("Role is associated with the user.");
        }</pre>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s