27 February 2009

Publish workflow failed on CRM 4 after installed Rollup 2

You may received this error, "The selected workflow has errors and cannot be published. Please open the workflow, remove the errors and try again."

Open the web.config file in the CRM installation directory.
Find "authorizedTypes ", then add another tag inside it.

26 February 2009

rsExecutionNotFound on CRM4's Reporting Server

Large CRM implentation normally design the SQL reporting services to run in an individual separate server to avoid the server overload. I faced an issue that wasted me 2 man-days to solved it.

Solution is very easy; I posted it out my experience, hope that can help you guys on similar issues.

I migrate my reporting services to new server, all seems to be very easy in CRM 4, just need to use the deployment management tools in CRM apllication server there, disable organization, change SRS URL only.

But the problem is after doing so, I cant render my reports at all. Spend almost 1 day to troubleshoot. I got the errors:

Crm Exception: Message: Execution '154xnnr3o5vqef55cimag0jc' cannot be found (rsExecutionNotFound), ErrorCode: -2147220332, InnerException: Microsoft.Reporting.WebForms.ReportServerException: Execution '154xnnr3o5vqef55cimag0jc' cannot be found (rsExecutionNotFound)at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters)at Microsoft.Crm.Web.Reporting.SrsReportViewer.ConfigurePage()

Additional, from the SQL log, I can see this:

w3wp!session!b!02/25/2009-00:48:45:: i INFO: LoadSnapshot: Item with session: znix5areosn3gmvnwkwr2x45, reportPath: , userName: domain\machine-name$ not found in the databasew3wp!library!b!02/25/2009-00:48:45:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException: Execution 'znix5areosn3gmvnwkwr2x45' cannot be found, ; Info: Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException: Execution 'znix5areosn3gmvnwkwr2x45' cannot be found

Problem is the error showing seems not much useful and describe the root cause after you know the root cause.
To solve this issue, for my case, just make sure all your FE server, reporting server.. configure to use the same datetime region.
What I can think off after this was the LoadSnapshot with session always deal with the session expired issue, because of the time region different, when you execute the report from front end, it found different time and your session expired!

19 February 2009

Timeout during heavy loaded tasks on CRM 4

I beleived most of us faced the problem where you can not change business unit of a user in CRM 4 or MSCRMSynchronous seems unabled to delete huge data. If you use CRM diagnostic tool to debug the request step by step, you will found it is cause by the timeout issue.

Default CRM4 application configure OLEDB timout as 30 seconds. We can modify the register in application server to extend the time. Refer the screen capture below:-

We just need to extend the OLEDBTimeout value and add a new DWORD key "ExtendedTimeout" . You can create the 2 keys if does not exist. By right OLEDBTimeout is already inserted during installation.

  1. Run >regedit
  2. expand the tree to >HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. Change the default value 30 on OLEDBTimeout to the seconds you prefer. (Modify by Decimal)
  4. Next, right click MSCRM, NEW DWORD rename to "ExtendedTimeout". (Modify the Decimal value to 1000000)
  5. Important: in Decimal value do not type value larger than 2,147,483,647
  6. After you successful run those 'resources hungry' tasks, set back to original value. Delte those key that previously does not exist.
Below is the exception I get in the event logs before I extend the timeout value.
Happy CRM'ing :D

Event Source: MSCRMAsyncService
Event ID : 17415

Exception: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Refer the Microsoft KB article also: http://support.microsoft.com/kb/918609

11 February 2009

Prompt Backdated Disallowed on CRM datetime field

CRM 4 date time control manage to minimize the error on user input by allow them to select a date from drop down calendar. Now, real word business scenario might required more advance of date time validation on date time field input.

Given scenario: Follow Up Date must be greater or equal to today.
The most easiest way to achieve the requirement is by Javascript; let see how it works
every time user change the field, onchange event on CRM fire the javascript to verify the input.

 <br />
function FollowUpDate() <br />
{ <br />
var current=new Date(crmForm.all.createdon.DataValue); <br />
var days=-1; //To handle crmForm onCreate or onChange <br />
if(crmForm.all.createdon.DataValue==null) <br />
{ <br />
d=new Date(); <br />
current.setFullYear(d.getYear(),d.getMonth(),d.getDate()); <br />
days=0; <br />
} <br />
<br />
var selected=new Date (crmForm.all.followupby.DataValue); <br />
<br />
var ONE_DAY=1000*60*60*24; <br />
var different=selected-current; <br />
var indicator=Math.round(different/ONE_DAY);  <br />
<br />
alert("Backdated disallowed for 'Follow Up By'."); 

Hope this simple javascript can help :)