Answered by:
Mail merge from CRM Outlook client: out of memory exception

Question
-
I'm having an annoying problem using mail merge functionality in one of our CRM 2011 Outlook Clients. At times when starting a mail merge, the user gets the error message that "An error has occurred in Microsoft Dynamics CRM Mail Merge". Word doesn't start, and closing the mail merge window then pops up another window showing the actual error that occurred, which is simply "Exception of type System.OutOfMemoryException was thrown.". Apparently it's thrown from the applychanges() function. This error seems to occur randomly, and there's no shortage of memory on the client or server. I've tried to trace the error in CRM on the server but no exception seems to occur there, so I think it's happening on the client. I'm not entirely sure at this point if it occurs for other users as well, since they don't use the functionality as often. It doesnt seem to be related to the actual template being used though. I haven't found any information on this subject, so I thought I'd try my luck here and see if someone has an idea on what the cause could be.
Wednesday, June 13, 2012 10:58 AM
Answers
-
I don't really know the exact cause, but the solution seems to be to reduce the mail merge templates to a size below 8MB. Anything above that may trigger the error. We increased the allowed attachment size in CRM to 16MB to be able to upload certain mail merge templates, but it's those mail merge templates that end up causing problems.Thursday, July 12, 2012 9:00 AM
All replies
-
Here's the error from the trace log on the client, apparently it's throwing the exception when calling System.Convert.FromBase64String().
at MailMergeForOutlook.PrepareDataSource(Int32 objectType, String objectId, Int32 recipientType, Int32 languageId, String templateId, Int32 mergeType, Boolean currentPage, String ids, String gridXml, String layoutXml, String& outLayoutXml, String& templateFileName) at UnsafeNativeMethods.DispatchMessageW(MSG& msg) at ThreadContext.LocalModalMessageLoop(Form form) at ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at Application.RunDialog(Form form) at Form.ShowDialog(IWin32Window owner) at Form.ShowDialog() at WebBrowserFormFactory.ShowModalDialog(IClientOrganizationContext context, Uri uri, Object arguments, String features) at CrmPageContext.Microsoft.Crm.Outlook.IManagedBrowserShell.ShowModalDialog(String url, Object arguments, String features) at <>c__DisplayClass28.<Microsoft.Crm.Outlook.IManagedBrowserShell.ShowModalDialog>b__25() at ExceptionFilter.TryFilterAllNoCatch(Func`1 body, Action`1 filter) at ManagedBrowserShell.Microsoft.Crm.Outlook.IManagedBrowserShell.ShowModalDialog(String url, Object arguments, String features) at RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > TraceException: Unhandled Exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Convert.FromBase64String(String s) at Microsoft.Crm.Application.Utility.MailMergeUtility.DecodeFileContent(String inputData) at Microsoft.Crm.Application.SMWrappers.MailMergeForOutlook.PrepareDataSource(Int32 objectType, String objectId, Int32 recipientType, Int32 languageId, String templateId, Int32 mergeType, Boolean currentPage, String ids, String gridXml, String layoutXml, String& outLayoutXml, String& templateFileName)
- Edited by Miguel_P Thursday, June 14, 2012 11:35 AM
Thursday, June 14, 2012 11:34 AM -
In an effort to try and solve the problem we're now trying to reduce the size of the templates to see if that helps. What's odd is that it still seems to be a client-side problem as the problem doesn't occur on all clients. The one where the problem is occuring the most is running Windows XP, but it also happened on clients running Windows 7.Thursday, June 21, 2012 10:51 AM
-
I don't really know the exact cause, but the solution seems to be to reduce the mail merge templates to a size below 8MB. Anything above that may trigger the error. We increased the allowed attachment size in CRM to 16MB to be able to upload certain mail merge templates, but it's those mail merge templates that end up causing problems.Thursday, July 12, 2012 9:00 AM