Fri 28 Aug 2009

Yesterday, after restoring CRM DB backup on other maching and importing Organization using Deployment Manager of CRM 4.0, I received this error.

The SELECT permission was denied on the object 'BuildVersion', database 'MicrosoftCRM_MSCRM', schema 'dbo'
or the variation
The SELECT permission was denied on the object 'SystemUser', database 'MicrosoftCRM_MSCRM', schema 'dbo'

If you have tried changing the owner of new database with admin login making it as dbowner but did not help then following may help solving this problem

Right click the affected object (table/view etc) in my case it was 'BuildVersion' and 'SystemUser' in SQL Server Management Studio,
click on properties
click on "Permissions" on left tab
click on "View schema permission" link on right tab
click on "Add" button,
click on "Browse" 
select "CRMReaderRole" of type Database role.
click ok,
click ok,
now you will be again in object properties.
Place check mark in "Grant" column against "Select" permission
click ok

Now check hope so it has been resolved.

================

To change the dbowner command is (If required)

use <CRMDatabaseThatYouNeedToChangeTheOwner>
exec sp_changedbowner 'DOMAIN\AdministratorMappedWithCrmAdmin'
go


===============

Comments (2)
Tue 25 Aug 2009

I was getting this error
No authority could be contacted for authentication
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.ReportingServices2005.ReportingService2005.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties)
   at Microsoft.Crm.Reporting.ReportServer.UploadReport(String path, Byte[] reportDefinition, String name, String description)

along with this error
Stack Trace Info: [MissingParameterException: The 'CRM_CalendarType' parameter is missing a value]
   at Microsoft.Reporting.WebForms.ParametersArea.ValidateAllReportInputsSatisfied()
   at Microsoft.Reporting.WebForms.ReportViewer.OnPreRender(EventArgs e)

This error may have many resons. The resoultion which help me in solving this problem was to first unjoin then again join report server machine to/from domain. 

If above did not help in solving then do the following which is "totally not recommended" and "should not do" in production server
Allow annonymous access and select priviliged user / administrator in ReportServer's virtual directory -> properties -> Directory Security

Tags: ,
Comments here
Sat 22 Aug 2009


Following code will help to Retrieve Cultures information from CRM into your Custom Web Application

                     // Retrieve the Locale IDs from the server.
                    RetrieveProvisionedLanguagesRequest reqLang = new RetrieveProvisionedLanguagesRequest();
                    RetrieveProvisionedLanguagesResponse resLang = (RetrieveProvisionedLanguagesResponse)crmService.Execute(reqLang);

                    // Create a CultureInfo array that represents the available languages.
                    System.Globalization.CultureInfo[] cultures =
                        new System.Globalization.CultureInfo[resLang.RetrieveProvisionedLanguages.Length];

                    for (int i = 0; i < resLang.RetrieveProvisionedLanguages.Length; i++)
                    {
                        cultures[i] = System.Globalization.CultureInfo.GetCultureInfo(resLang.RetrieveProvisionedLanguages[i]);
                    }


If you are looking for Globalization / Localization in Custom Web Application, have a look at

http://faisal.azmza.com/post/2009/08/21/CRM-Globalization-Localization-in-Custom-Web-Application.aspx

 

 

 

Tags: ,
Comments here
Fri 21 Aug 2009

If you required to set localization / culture in your custom web application that is running in IFRAME section of your CRM Application, according to User preferred language selected by user in Language option, go with the following

 Override the InitializeCulture() method in your custom web application as


        protected override void InitializeCulture()
        {
                base.InitializeCulture();

                WhoAmIRequest whoAmIRequest = new WhoAmIRequest();
                WhoAmIResponse whoAmIResponse = (WhoAmIResponse)crmService.Execute(whoAmIRequest);

                // Get the usersettings entity
                RetrieveUserSettingsSystemUserRequest reqUserSettings = new RetrieveUserSettingsSystemUserRequest();
                reqUserSettings.EntityId = whoAmIResponse.UserId;
                ColumnSet columns = new ColumnSet();
                columns.Attributes = new String[] { "uilanguageid" };
                reqUserSettings.ColumnSet = columns;
                reqUserSettings.ReturnDynamicEntities = true;
                CrmNumberProperty langProp = null;
                int langCode = 0;
                try
                {
                    //Get current logged in user setting
                    RetrieveUserSettingsSystemUserResponse resUserSttings = (RetrieveUserSettingsSystemUserResponse)crmService.Execute(reqUserSettings);
                    DynamicEntity objUserSettings = (DynamicEntity)resUserSttings.BusinessEntity;
                    foreach (Property prop in objUserSettings.Properties)
                    {
                        langProp = (CrmNumberProperty)prop;
                        if (langProp.Name.Equals("uilanguageid"))
                        {
                            //langCode = (CrmNumberProperty)objUserSettings.Properties["uilanguageid"];
                            langCode = langProp.Value.Value;
                            break;
                        }
                    }

                    //Set culture
                    Thread.CurrentThread.CurrentCulture = new CultureInfo(langCode);
                    Thread.CurrentThread.CurrentUICulture = new CultureInfo(langCode);

               }

                catch (System.Web.Services.Protocols.SoapException se)
                {
                    // Log it
                }
        }

If you are looking for Retrieve Cultures information from CRM into your Custom Web Application, have a look at

http://faisal.azmza.com/post/CRM-Retrieve-Cultures-information-from-CRM-into-your-Custom-Web-Application.aspx

 

Tags: ,
Comments here
Wed 19 Aug 2009

If you are getting a popup while navigating through Microsoft Dynamics CRM Application asking you to save Blank.aspx file, following workaround will help you

 

 

Please edit the default blank.aspx file in CRM (Sever where CRM is installed) so it contains data. This file is located at My Computer | System Drive | Program Files | Microsoft Dynamics CRM | CRMWeb |_ root. Here you will find the Blank.aspx text file.

 

Open the file and add some text to the file, for example you can add "Test" to the file (then there would be following three lines)

 

Test

<% Response.Expires = 1440; %>

<% Response.Cache.SetCacheability(HttpCacheability.Public); %>

 

 

 

Once you have added data, save the file, clear your temporary Internet Files, and do an IISreset. Once this is done go back into CRM to verify that this has resolved this issue.

 

 

 

 

Comments (7)
Tue 18 Aug 2009

If you get following exception while uploading / creating new report using Source Report Type -> Exising file

==============
[CrmException: Exception of type Microsoft.Crm.CrmException was thrown.]
  Microsoft.Crm.Application.Platform.Report.InternalCreate(String xml) +721
  Microsoft.Crm.Application.Platform.Entity.Create() +109
  Microsoft.Crm.Application.Forms.AppForm.RaiseDataEvent(FormEventId eventId) +408
  Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) +57
  Microsoft.Crm.Application.Forms.EndUserForm.Execute(Entity entity) +13
  Microsoft.Crm.Web.Tools.ReportProperty.ReportPropertyPage.ConfigureForm() +202
  Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e) +30
==============

The issue lay with our RS permissions.
In addition to failing to upload reports, we tried downloading them from CRM too. This gave us an NT permissions error.
So, we opened up (localhost)/reports, navigated to the CRM datasource (typcially 'Organization_MSCRM), then properties, then security,
and then added a user / group called NT AUTHORITY\NETWORK SERVICE,
and gave them the permissions of CRM Publisher.
After that it all worked fine.

Thanks to Lee/Ronald

 

Comments here
Tue 18 Aug 2009

If you get following exception while uploading / creating new report using Source Report Type -> Exising file

=============
Stack Trace Info: [NullReferenceException: Object reference not set to an instance of an object.]
   at Microsoft.Crm.Reporting.SRSReport.convertDataSource()
   at Microsoft.Crm.Reporting.SRSReport..ctor(String xmlContent, String originalFilter, Boolean convertReportToCrm, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.ReportService.CreateInternal(IBusinessEntity entity, Boolean isScheduledReport, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.ReportService.Create(IBusinessEntity entity, ExecutionContext context)
=============

The reason can be the Shared Datasource used while creating Report in Visual Studio 2005.

1. Create a new Report Project in Visual Studio 2005

2. Right click on Reports, choose to add Existing Item

3. Double Click on the report to open it.

4. Click on the Data (top tab) above the open report file.

5. Click the "..." button just to the right of Dataset to open Dataset Properties.

6. Click on the "..." button to the right of the Data Source drop down list.

7. Clear the "Use shared data source reference" option.

8. Click on the "Edit..." button to the right of Connection string.

9. Enter the correct SRS Server Name, enter the authentication method, and choose the correct database name.

10. Click OK, this will change the source for the entire report.

11. Click OK to the Visual Studio window again.

12. Choose, File, Save <Report>.

13. Try to upload it again. This time it should load.

 Thanks to mennotk

 

Comments here




Ads