I was seeing an issue (exception thrown) when updating lists of users. The exception complained that the user had no roles in CRM. I've modified the code to catch the error, which does the job, but is maybe a little crude. I couldn't understand why the lack of a role should cause an error when retieving the user settings for that user on line:
var records = detail.ServiceClient.OrganizationServiceProxy.RetrieveMultiple(new QueryByAttribute("usersettings")
A better fix would be to ensure this call does not fail for users with no roles assigned in CRM.
Anyway - the amended code worked for me, and allowed me to finish the job at hand. Updating 400 users to be in the right time zone :)
I was seeing an issue (exception thrown) when updating lists of users. The exception complained that the user had no roles in CRM. I've modified the code to catch the error, which does the job, but is maybe a little crude. I couldn't understand why the lack of a role should cause an error when retieving the user settings for that user on line:
var records = detail.ServiceClient.OrganizationServiceProxy.RetrieveMultiple(new QueryByAttribute("usersettings")
A better fix would be to ensure this call does not fail for users with no roles assigned in CRM.
Anyway - the amended code worked for me, and allowed me to finish the job at hand. Updating 400 users to be in the right time zone :)