This blog talks about an issue we face while running out of the box or custom reports from Microsoft Dynamics CRM 2011. We will observe that few users in CRM organization are able to run the report. Few other users would suddenly start getting script errors and unable to run any reports from CRM. In this scenario we receive different script errors. Following are the script errors we receive with the error message :-
'Sys' is undefined
ORMessage: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
Webpage error details:
User Agent:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2;.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Tue, 17 Jul 2012 22:43:06 UTC
Message: Object expected
Following are the screenshots of the error we see when running reports from web client:-
Following is the screenshot of the error message we receive from CRM outlook client :-
I collected the CRM platform traces and found we see below error message which is weird as my user has a system administrator security role in the CRM organization from here the user is unable to run the report and receive the script errors:-
Error: The user is not assigned any privileges.
Error Number: 0x80042F09
Error Message: The user is not assigned any privileges.
Error Details: The user is not assigned any privileges.
Source File: Not available
Line Number: Not available
Request URL: http://xxxxx/WebResource.axd?d=Mih2KhqNXiMEZcdPxFxoPU35ZpqXzx5IgE22KWlLHEGWElPjg7jxqVW8lNuhobKyfviBzEIss0CJLe14lrREo7AchKHgzXS7E5qUN7rDMW41&t=634670320007546920
Stack Trace Info: [CrmException: The user is not assigned any privileges.]
at Microsoft.Crm.MainApplication.Application_OnPostAuthenticateRequest(Object sender, EventArgs eventArguments)
An error occurred during the Application_OnPostAuthenticateRequest :
Stack Trace: at Microsoft.Crm.MainApplication.Application_OnPostAuthenticateRequest(Object sender, EventArgs eventArguments)
This issue looked really different to me until I found out how the authentication works when a user runs a report from a particular organization in CRM.
CAUSE OF THIS ISSUE
This issue occurs when a user does not have Security Role assigned to him in his default organization in CRM . Now, by user's default organization we mean that organization in entire CRM deployment where the user was first created.
For instance I have 3 organization ORG1, ORG2 and ORG3 in CRM . I created a user say user1 in AD and then created this user as a CRM user in ORG 1 for the first time. Thus, ORG1 becomes the default organization for this user. Next, if I create the same user user1 in ORG2 it will not make a difference ORG1 still will be the default organization for USER1.
Thus, if future if we remove the security role of user1 from ORG1 , USER1 will not be able to run any reports from ORG2 or ORG3. The user will get all the above mentioned script errors.
REASON FOR THE AUTHENTICATION FAILURE
The issue is caused when the user is being authenticated to access the ScriptResource.axd, WebResource.axd and Reserved.ReportViewerWebControl.axd controls. The UserCache is being examined while running any report to authenticate the user using the default rganization information and since the user doesn't have any privileges in that organization, the authentication fails and throws an exception.
To resolve this issue we should to give a security role to the user in his default organization. Please follow the steps mentioned in the last section on how to find default organization for any CRM user.
I have also seen this issue occurring in scenarios where user's has security role in his default organization but that default organization is being disabled and no more in use but still present in deployment manager. Hence, in such cases either delete the disabled or unused organization from CRM deployment or enable the organization.
To know HOW TO FIND DEFAULT ORGANIZATION FOR ANY USER IN MULTIPLE ORGANIZATION CRM DEPLOYMENT please refer to following blog :-
Good explanation, but i didnt understood why you have written two different blogs in one place.
Khaja Mohiddin : - Do you mean Explaination of How to find Default Organization for a user in this bolg ? Well, we need to give security role to the user in default but users mught not know how to find that and hence the explaination..
Well documented. Helps a lot. Thanks!
Great post. This solved my problem. Thank you so much
I have added a new user in an Organization and provided him the System Administrator role. And after that I have created a new Advance Find Report. But the report is not working and giving the same error.
The new user in this org ,was he the user in any existing organization? If no , then the issue might different related to missing SPN etc. You would probable need to check CRM platform trace or reporting logs
Great post. It resolved our issues. Thanks,