The Microsoft CRM Email Router Service will not start every time you start it manually from Services and throws an error message "The Microsoft CRM Email Router service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
Event log entries say:
Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
#16192 - The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down. System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing.
This means your Email Router configuration file is corrupted.
You need to go to C:\Program Files\Microsoft CRM Email\Service and delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file. Try to re/start the Email Router Service. This should resolve your problem.
If your email router does not process any emails but your inbox from Email Provider works just fine!?! Check event logs where Email Router is installed. You might see many repeated errors similar to mentioned error here below:
#27938 - An error occurred while checking for email messages to process in mailbox firstname.lastname@example.org. Microsoft.Crm.Tools.Email.Providers.EmailException: Error: The message exceeds the maximum supported size.
at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.LogEwsResponseErrorWarning(String message, ResponseClassType responseClassType)
at Microsoft.Crm.Tools.Email.Providers.ExchangeWSConnector.RetrieveMessage(ArrayList ids, Int32 index, ServiceLogger serviceLogger)
Check your inbox for the emails with attachments. Find emails with more than expected attachments size per email, take backup (if required) and delete them. Your Email Router should work just fine once this is done!
In my case an email with 100+ MB attachment size was creating an issue.
If you are working on code to merge two entity records and come across "Cannot specify child attribute retrieve" error; and you have referred SDK/MSDN documentation. You probably have kept UpdateContent property optional and havent set it. UpdateContent is a required property though the documentation says it is not.This property is optional in case of merging incidents only.
You just have to set Entity object to UpdateContent property which has attributes to be updated to the merged record. HTH!
I ran into this small issue when I was asked to convert a text field into a Single Select Dropdown. As we were doing this for a demo, I thought I will try this little hack to avoid adding a table in database and whole nine yards.
I am not sure how useful this is going to be to someone but I am hoping that.. someday.. someone will benefit from this.PS: Due to certain restrictions the following code snippet is missing appropriate closing script() tags. Kindly add them if you copy the code to use it somewhere.