Archive for the ‘Dynamic CRM 4.0 - Installation / Errors’ Category
Thursday, May 1st, 2008 |
Last week I have been looking for the best approach to use auto numbers in Microsoft Dynamics CRM. After discussion with my peers I have come to the following possible options that can be used for auto numbering. Although these may not be the efficient techniques to get auto number work in CRM but they are all workable solutions.
Option 1:
Very simple, supported and mostly acceptable way of auto numbering is to read the attribute Max value and then add 1 to get next auto number. For example you have a custom entity named Project and you want to auto number Project_Ref_Number attribute. But do not retrieve all records. Just retrieve the record with maximum number value by using following two properties of PageInfo Class in SDK and set descending order.
PageInfo.Count = 1;
PageInfo.PageNumber = 1;
One more consideration should be taken in account to register your auto number plugin to at PreCreate rather at PostCreate.
Issues:
In multi-user environment, this approach can come up with duplicate numbers in Project_Ref_Number when more than one user is creating project records.
Option 2:
This technique requires a bit more work but still supported way of doing things and all the time you will be getting 100% unique number.
You need to create a new table for project entity in a different database and not in CRM default database.
create table dbo.ProjectNumbers
(
Project_Ref_Number int identity(1,1) primary key clustered,
Projectid uniqueidentifier not null
)
go
Create a stored procedure for inserting a record into new database. This will increase the performance of your insert query.
create procedure dbo.proc_new_ProjectNumber
@ProjectId uniqueidentifier,
@Project_Ref_Number int output
as
insert into dbo.ProjectNumber
(
ProjectId
)
values
(
@ProjectId
)
select @Project_Ref_Number = scope_identity()
go
In your Plugin/Callout:
1. Access you database using ADO.NET
2. Execute stored procedure and get next number from returned results
3. Set the value of the returned number to target entity attribute approperiatly.
4. All Done
Issues:
1. You have to setup database.
2. You have to read and insert into external database.
Option 3:
This option used a lock mechanism on a text file placed somewhere at your webserver. You can create one file to store next number for all entities or you can create one file for each entity. In your Plugin/Callout:
1. Put a lock on file.
2. Read the file and read the number there.
3. Update the number by adding 1.
4. Release the lock.
5. Use this number and set your target entity attribute appropriately.
string ProjectAutoNumber = “FilePath”
lock(this)
{
TextReader textReader = File.OpenText(ProjectAutoNumber);
AutoNumber = textReader.ReadLine();
textReader.Close();
AutoNumber = (long.Parse(AutoNumber) + 1).ToString();
TextWriter textWriter = File.CreateText(ProjectAutoNumber);
textWriter.WriteLine(AutoNumber);
textWriter.Close();
}
Issues:
1. Resource locking
2. File system Read/write cost
Although all these options work well but I am still looking for some more robust solution. Ideally I am looking for something like GUID. GUID’s are instantly available and 100% unique.
For your suggestions and improvements, please comment.
Posted in Dynamic CRM 3.0, Dynamic CRM 4.0, Dynamic CRM 4.0 - Installation / Errors, Dynamic Online CRM | 2 Comments »
Monday, April 14th, 2008 |
Well this may or may not help someone out there - but I thought I would put up a post to save you some time if you are in the same situation! Here is where I was at:
- Used Microsoft Dynamics CRM 3.0 w/outlook client
- I am running Vista with Office 2007
- We upgraded to 4.0
- Could not get the 4.0 Outlook Client to work!
I think the big issue is that there is not a great way to clean your system of the 3.0 Outlook client. I found numerous posts on what to do…but I still had no luck. At one point I even completely uninstalled Office (at-least I thought I had) . The screen shot below shows the sign of the remnant 3.0 client - I was never able to get ride of the greyed out CRM menu item.

Then when I would go to configure the new 4.0 client after installing - all went well till right at the end then poof - the error below showed up.

I did everything I could to solve - then had about 3 different CRM specialists look at and try to solve to no avail! I finally called in a support case and without too much pain got the issue solved.
Below is the relevant info
Scope:
**********************
After uninstalling CRM 3.0 and then installing the 4.0 client you are unable to access CRM in Outlook and you have a duplicate toolbar loading.
“An error occurred loading Microsoft Dynamics CRM functionality”
Environment:
**********************
Vista
CRM 4.0
Assessment:
**********************
First to help remove the Duplicate toolbar that we are encountering I would like you to go through the below steps. I know you mentioned that you had your CRM engineers completely uninstalled CRM 3.0 so before going through a clean Uninstall I would like you to navigate to “C:\document and settings\user\application data\Microsoft\Outlook” When running under vista it should be located C:\Users\”Username”\AppData\Roaming\Microsoft\Outlook. When you find the Outlook folder I would like you to Rename this from Outlook to OutlookOld. Then I would like you to reload your Outlook client and verify that the Duplicate toolbar no longer exists.
They had listed out a number of other steps as well - but I knew once I renamed the folder and the phantom CRM button on my toolbar disappeared I was in business. Sure enough the install went clean and I am up and running!
The only downside to this is the loss of some personal settings in Outlook and the stored pre-popped address that I had built up.
Posted in Dynamic CRM 4.0, Dynamic CRM 4.0 - Installation / Errors | 5 Comments »
Friday, February 22nd, 2008 |
This my 2nd article on installation issues regarding Microsoft Dynamics CRM 4.0. However, the info below applies to both MS CRM 3.0 and 4.0.
Article 2 - Send Email Errors and Corrupt Attachments.
After running CRM for a few days all is going well, except for sporadic errors being reported by users related to sending emails via the web client. The errors seen by the users can be:
“Invalid Association: The request association is not valid”
“Invalid Visibility Modification Access”

Or
Attachments are being sporaticaly corrupted.

So how do we fix this.
Step A. First, if you are running MS CRM 3.0. Either install Rollup 2.0 or install the hotfix related to Microsoft KB Article 9299904. This is an issue specificaly related errors when sending attachments containing special characters in the file name (! @ # $ etc).
Step B. Second, try follow the recommendations on this Microsoft KB Article 916925
In CRM 3.0 the smtp server and smtp options can be changed via registry keys in the MSCRM registry area area.
In CRM 4.0 the smtp server and options can be changed via the CRM Email Router.
Step C. In addition to the above recommendations, if you are using the Microsoft SMTP service, very that no restrictions are set on incoming email messages.

It is always a good idea to also verify that relaying is ONLY allowed from the local the local server and as an additional layer of protection, use ipsec filtering or the windows firewall to completely block access to incoming smtp connections.
Step D. If the above recommendations still do not fix the issue, then step C is to disable ‘ip chimney’. In layman’s term, ip chimney is a method of offloading tcp/ip processing from the CPU to a network card that supports this. This is turned on by default with Windows 2003 SP2. Certain older network cards or drivers have problems with this. To disable ip chimney, issue this command on a dos window:
Netsh int ip set chimney Disabled
That’s about it. If after trying steps a,b,c,d you sill have issues with sending emails with either crm 3.0 or 4.0, feel free to post a comment in this blog. Thanks for reading!
Posted in Dynamic CRM 4.0 - Installation / Errors | No Comments »
Friday, February 8th, 2008 |
Updated April 16, 2008.
I’ll be writing a series of articles regarding the various issues that we have encountered while installing CRM 4.0 and migration CRM 3.0 to 4.0. We have found solutions and fixes for all of these. Hopefuly these articles will save you some time or tickets with Microsoft.
Article one - the dreaded “The Microsoft CRM Asynchronous Processing Service service terminated unexpectedly” service crashes.
After finaly installing CRM 4.0 and upgrading your organization, everything appears to be running OK. However, a small crm service called MSCRMAsyncService keeps crashing. The quick fix is to set the service to automatically restart after a crash and do this perpetually:

However, this is not a good fix as it will lead to a small memory lead that will eventually cause CRM to completely stop responding. This will also make your system log not very usable as it will be filled with service crashes and restart:

So what is the fix?
Here are the 3 action items should fix this if the issue is related to workflows being ’stuck’ or not running properly.
Action A. Set the MSCRMAsyncService to run as ‘local system’ instead of ‘network service’ account.

Action B. The MSCRMAsyncService is processing a workflow and for some reason it is crashing. These workflows are probably old, stuck, and perhaps missing some type of required resource. To identify these workflows, use the System Jobs in the Settings area.

Then created an advanced find view to search for ‘in progress’ or ‘waiting for resource’ workflow jobs.

Examine the actual workflow to see why they are not running properly. First, fix or stop the actual workflow that is not running properly. Then go back to this advanced find, and ‘cancel’ any in progress and ‘waiting for resources’ workflow that has been in this status for a while.

Depending on the number of running/stuck workflows that are being cancelled, this may take a while.
This alone may solve this issue. If it does not, then proceed to plan B.
Action C. So after having this blog post for a few weeks I received an email from Microsoft Support stating that Action C can cause major damage. Action C used to suggest to a full sql backup on the config database and the organization(s) database then delete dbo.WorkflowWaitSubscriptionBase, dbo.WorkflowLogBase, dbo.DuplicateRecordBase, and dbo.AsyncOperationBase. Do not do this as it could have side effects including stopping out of the box jobs such as duplicate detection jobs, contract state jobs, and full text catalog jobs.
Instead take a look at KB949844 and KB950680. These are two hotfixes related to the CRM Asynchronous job.
If this helps you, please let us know!!!
Posted in Dynamic CRM 4.0 - Installation / Errors | 10 Comments »