Thursday, December 22, 2011

Async Operation failed

Hi,

Async Operation failed and I want to get the reason.

Run this SQL and read the message

USE ORG_MSCRM

SELECT createdon,message,PrimaryEntityType,Name,Depth FROM AsyncoperationBase

WHERE statecode = 3 AND statuscode = 31 AND Deletionstatecode = 0

ORDER BY createdon DESC

VIEW THE ERROR IN message.

THANKS,

Rami Heleg

Thursday, June 2, 2011

Invalid argument for field "incomingemaildeliverymethod" in systemuser

Hi,
 
Valid values for Picklist in CRM 3,4,2011 start from 1, 2. Values empty or 0 are not valid.


Example for picklist values:

Value                Name

0                                              Israel

1                                              USA

2                                              Holland



I have found a pick list with empty value.

Problem appears in Systemuser field incomingemaildeliverymethod.



The field incomingemaildeliverymethod values start from 2 and the first value is empty.



If I try to create new systemuser and set value for this field in pre create event values 0 or empty error message “Invalid argument “



The solution is to create a new field Picklist and set the value like that:



Microsoft.Crm.Sdk.Picklist incoming = new Microsoft.Crm.Sdk.Picklist();

incoming.name = "ללא";

// Set values for this field in pre create

ContextUtils.SetProperty(context, "incomingemaildeliverymethod", incoming, typeof(PicklistProperty));

Now the set values works correctly

Thanks,

Rami Heleg

Monday, February 14, 2011

Clean AsyncOperationBase table

Hi,
Highly recommend to clean table AsyncOperationBase for performance issue.
http://support.microsoft.com/kb/968520

this script clean the table and improve Async operations.
thanks,
Rami Heleg.

Friday, November 12, 2010

Failed to view Report server and get error message "The page cannot be found"

Hi,\
i tried to create a new organization and i faild because report server is down
when view the reportserver url get error message:


















To Fix the problem needs to open Reporting Services Configuration manager and press Start.














\



vwalla report server works.. and now i can create a new organization



















Thanks,
Rami Heleg

Sunday, November 7, 2010

Redeployment CRM failed after success to import users and failed to import report

Redeployment success to import a few reports but failed to import all reports.

In this case need o delete report server Encryption:





















thanks,
Rami Heleg

Failed to redeployment CRM organization

Failed to redeployment CRM organization and get the error message:


13:02:20
Error
Import Organization (Name=LeumiCim, Id=782be048-dde4-df11-968c-00145ebd47b6) failed with Exception:

System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)

at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)

at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)

at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)

at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)

at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)

at Microsoft.Crm.CrmDbConnection.SetTransactionIsolationLevel(IsolationLevel il)

at Microsoft.Crm.CrmDbConnection.Dispose(Boolean disposing)

at Microsoft.Crm.SqlExecutionContext.Dispose(Boolean disposing)

at Microsoft.Crm.SqlExecutionContext.Dispose()

at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)



After check this error I got that the problem is missing temporary database for reporting service.

Reporting services contain 2 databases:

1. ReportServer

2. ReportServerTempDB

By mistake the database ReportServerTempDB.

To return the temporary database open "Report server Configuration"

.select "database setup" and press "New"





















This option creates the temp database after this process try to run again the redeployment tools.



Thanks,

Rami Heleg

Sunday, October 24, 2010

View CRM log files for instance redeployment file:

View CRM log files for instance redeployment file:


Go to start run write %APPDATA%

Select folder Microsoft\MSCRM\Logs

Many files appear, in this case select the latest modified file.



Thanks,

Rami Heleg.

Redeployment success but get in error message in log file because update version id

Hi,
Redeployment success but get in error message in log file because update version id :

14:54:56
Info
Applying database updates to the organization...

14:55:12
Info
Updating BuildVersion.Revision for all Organization Databases

14:55:12
Warning
Attempting to cancel a long running process: ProgressWizard. This might leave the data in an invalid state and the application might not function correctly.

14:55:12
Info
Organization (XXX) imported.

16:35:51
Warning
Attempting to cancel a long running process: FinishWizard. This might leave the data in an invalid state and the application might not function correctly.

16:35:51
Info
Deployment Manager Exit

The solution for that: install rollup 13 ( never mind if exist ) . Redeployment failed to update version in DB.

Thanks,
Rami Heleg

Tuesday, October 12, 2010

Time out When Email router run SQL queries

Hi,
CRM/Email router return time out when retrieve email queries.
The reason is to query to retrieve Activities/Email.


To solve the issue must add parameter to register.

1. Under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\registry subkey on the Microsoft Dynamics CRM server, add the following REG_DWORD registry entry: SmartMatchingForceOrder

2. Set the value of the registry entry that you just added to 1

BTW Rollup 13 must be installed

Thanks,
Rami Heleg

Monday, October 11, 2010

Use Thread to improve performance.

Option to improve performance for callouts or just server side is to use thread

Here Is an example of using thread:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace thread {

class Program {
static void Main(string[] args) {
  System.Threading.ThreadPool.QueueUserWorkItem(f => {xxx();});
  }

  static void xxx(){
  int a = 8;
  }
 }
}



Enjoy,

Rami Heleg

Sunday, October 10, 2010

How to create a new organization/ import organization and prevent from insert report service URL…?

Everyone know to create/import organization must insert report URL.


We can prevent insert the report URL and of course success to create organization …

How to do that….?


Add the IgnoreChecks registry key to the computer that is running Microsoft Dynamics CRM 4.
 click Run, type regedit, and then click OK.
In the registry, locate the following subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
Right-click MSCRM, point to New, click DWORD Value, and then type IgnoreChecks.  + set Value 1.
Sceen shots:








Thanks,
Rami Heleg

Saturday, October 9, 2010

Failed to open CRM. get error message License Expired.

Hi,
  Open CRM and get error message in CRM+ in event viewer “license expired”.
  Error message appears in two modes.

  1. The first case when the license expired.
  2. When service MS Async Service is down.

Go to services windows, select Async service and run again.
Thanks,
Rami heleg

Find CRM entity name by ObjectID

Everybody knows this strange error message from CRM trace logs: Error Message: SecLib::AccessCheckEx failed. Returned hr = -2147187962, ObjectID: 48355f9a-96c5-df11-90dc-00145ebd47b6, OwningUser: 6d04898c-db79-df11-83b4-00145ebd47b6 and CallingUser: 9cfc1a56-da79-df11-83b4-00145ebd47b6.
CRM failed to perform some action on an entity with ObjectID = 48355f9a-96c5-df11-90dc-00145ebd47b6
The error does not contain the problematic entity name I prefer to know.
So I wrote the SQL script that helps me to find an entity name by ObjectID

DECLARE @objectId uniqueidentifier

SET @objectId = '41DC59A0-96C5-DF11-90DC-00145EBD47B6' – Set your ObjectID here
DECLARE @entityName nvarchar(255), @baseEntityName nvarchar(255), @primaryKeyColumnName nvarchar(255), @sql nvarchar(max), @isActivity bit
DECLARE cur CURSOR FOR SELECT Name, BaseTableName, IsActivity from Entity with (nolock) where IsValidForAdvancedFind = 1
OPEN cur
FETCH NEXT FROM cur INTO @entityName, @baseEntityName, @isActivity
WHILE @@FETCH_STATUS = 0
BEGIN
if(@isActivity = 1 OR @entityName = 'ActivityPointer')
SET @primaryKeyColumnName = 'activityid'
else
SET @primaryKeyColumnName = @entityName + 'id'
SET @sql = 'IF EXISTS(SELECT ' + @primaryKeyColumnName + ' FROM ' + @baseEntityName + ' WHERE ' + @primaryKeyColumnName + '=''' + CONVERT(nvarchar(36), @objectId) + ''') SELECT ''' + @entityName + ''''
exec(@sql)
IF @@ROWCOUNT > 0 BREAK;
FETCH NEXT FROM cur INTO @entityName, @baseEntityName, @isActivity
END
DEALLOCATE cur

Thanks,
Max s

Thursday, September 23, 2010

Define opening CRM as a application

Go to system setting
Select tab: Personal Settings

Select the check box like the image linked
Close the explorer and open the CRM again.



Thanks,
Rami Heleg

Wednesday, September 15, 2010

Failed to install CRM 4.0

Failed to install CRM 4.0.

Failed to install CRM 4.0 and get error message
"the account specified to run the microsoft dynamics crm asynchronous processing service does not have performance counter permissions..."

in Microsoft Dynamics CRM Setup windows.

The reasons can be:
installer must be local admin.
define CRM to run CRM in a user which is not local admin. ( enable to view this data after install in iis - application pool)

Thanks,
Rami Heleg

Monday, August 16, 2010

Get CrmService for specific organization.

I have many organizations and I need the entities for specific organization

The solution


Create crm service where URL contain
?uniquename=org_name

for instance:
http://servername/MSCRMService/2007/Crmservice.asmx/?uniquename=org_name
enjoy,
Rami Heleg

Monday, August 9, 2010

Working with GAC

I CRM 4.0 usual is to work with GAC (Global assembly cache)
Replace file, delete file, copy file.
If failed to delete or copy file from GAC
Make the next instructions:
How to view windows/assembly folder
1. Open Regedit, browse to HKLM\Software\Microsoft\Fusion.
2. Add a REG_DWORD value named 'DisableCacheViewer'; set it to 1
3. open an Explorer window and type in C:\WINDOWS\assembly\GAC_MSIL\

Open GAC ( c:\windows\assembly\msil and copy the relevant file and remove
After finish change 'DisableCacheViewer' to 0
Thanks
Rami Heleg.

Monday, July 19, 2010

Hide field in client side

Hi,
Here is fnunction to hide field in client Side, Javascript:

function HideField(fieldName, visible) {
var label = document.getElementById(fieldName + '_c');
var value = document.getElementById(fieldName + '_d');
if (label)
label.style.display = visible ? 'inline' : 'none';
if (value)
value.style.display = visible ? 'inline' : 'none';
}


thanks,
Rami Heleg

Sunday, July 18, 2010

How to find which Rollup CRM installed?

I installed some rollups.

i want to know if i installed specific version

1. open control panel/ installed updated and check which version like next picture



2. if you see only KBXXX go to crm download rollup center and check the rollup id like this pictures



thanks,
Rami Heleg.

Monday, July 12, 2010

Using RemoteCommand in CRM 4.0

What is it RemoteCommand ?
RemoteCommand is Microsoft XmlHttp interface.

Microsoft blocked the option to use RemoteCommand in CRM 4.0
How to use RemoteCommand in CRM 4.0?
1. Copies file RemoteCommand.JS from CRMWEB\_static\_controls\RemoteCommands to user local folder with JS and rename the file for instance customRemote.js
2. Rename function: RemoteCommand to CustomCommand and add another parameters for instance:
function CustomCommand (sObject, sCommand, sUrlBase, sNamespace)
3. Change the row:
var sCommandNamespace =_sWebServicesNamespace; to
var sCommandNamespace = sNamespace ? sNamespace : _sWebServicesNamespace;

finish to change the file.

Call to function from Javascript:

var cmd = new CustomCommand('webServiceName', 'functionName', '/MySite/', 'http://NameSpace');
cmd.SetParameter('incidentID', objectid);
cmd.SetParameter('targetID', instanceID);
var rslt = cmd.Execute();
if (!rslt || !rslt.ReturnValue){
//work good
return;

}
if (rslt.ReturnValue.errorDescription) {
//Failed
alert(rslt.ReturnValue.errorDescription);
return;
}

Define name space in c# code:

[WebService(Namespace="http://NameSpace")]
public class webServiceName: System.Web.Services.WebService {


thanks,
Rami Heleg,