Monday, July 18, 2011

CRM 2011 - Remove Pending E-mail Warning on Login

Want to get rid of that annoying Pending e-mail warming you see every time you log in to your Microsoft CRM 2011 system?  


Modify your url to open directly to page main.aspx with the skipNotification query string parameter set to 1.


For example, if you are on-premise and use a URL like so:
http://contoso:5555/{Organization Name}


use the following instead:
http://contoso:5555/{Organization Name}/main.aspx?skipNotification=1


If you are claims-based (IFD) and use a URL like so:
https://{Organization Name}.contoso.com:5556


use the following instead:
https://{Organization Name}.contoso.com:5556/main.aspx?skipNotification=1


For on-line customers using a url like:
https://{Organization Name}.crm.dynamics.com


use the following instead:
https://{Organization Name}.crm.dynamics.com/main.aspx?skipNotification=1


Save it to your bookmark and stop growling (if you're like me) every time you open up CRM!


Update 2016/10/03:  Note on-premise customers can implement a registry key to disable this warning.  Please refer to DisablePendingEmailReminder http://social.technet.microsoft.com/wiki/contents/articles/13661.dynamics-crm-2011-quick-optimization-guide.aspx

Sunday, July 17, 2011

Microsoft CRM 4 Plug-in Serialization exception in CRM 2011

This is how one blogger solved a program plug-in after converting from CRM 4 to CRM 2011. The message was below (which you're probably getting if you're landing here).  In my case I was using the Property bags to pass values between plug-in instances (in this case from a syncronous plug-in to an asyncronous plug-in).  The problem was I was using the CRM 4 types (Lookup, CrmNumber, CrmMoney) as the values in the bag.  Apparently those assemblies weren't available where the serialization of the context occurs.  The solution was to switch to using the GUID, integer, decimal, etc.

If you get this for another reason, leave a comment and I'll update the post with other possible solutions.

<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

  <ErrorCode>-2147220970</ErrorCode>

  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">

    <KeyValuePairOfstringanyType>

      <d2p1:key>CallStack</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)

   at WriteKeyValuePairOfstringanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )

   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)

   at WriteParameterCollectionToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )

   at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)

   at WriteAsyncOperationDataToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )

   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)

   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)

   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)

   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)

   at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)

   at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)

   at Microsoft.Crm.Extensibility.AsynchronousStep.SerializeAsyncData(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.AsynchronousStep.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)

   at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)

   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)

   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)</d2p1:value>

    </KeyValuePairOfstringanyType>

  </ErrorDetails>

  <Message>System.Runtime.Serialization.SerializationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #3B579A6A</Message>

  <Timestamp>2011-07-18T19:23:54.5853968Z</Timestamp>

  <InnerFault i:nil="true" />

  <TraceText i:nil="true" />

</OrganizationServiceFault>

Thursday, July 7, 2011

CRM 2011 Bulk Edit - Scripts Not Running? Fields disabled?

Similar to MSCRM 4, events won't fire by default in CRM 2011.  Also, any field with an onchange event will be rendered disabled!  There is a nasty way to go about it enabling these fields or allowing your scripts to execute.

Export the entity you wish to enable scripted bulk edits for in an unmanaged solution.  Un-zip the package and open up customizations.xml.

To allow an event, follow the below xpath which will take you to the events for a form.  If you have multiple forms, you may repeat for each form (TBD:  not sure if these appear under systemform or not).  If you're enabling for multiple entities, you may repeat for each entity.

\\ImportExportXml\Entities\Entity[@name='new_entityname']\FormXml\forms[@type=’main’]\systemform\form\events\event[@name=’onload’]


This xpath takes us to the onload event for the main form of the new_entityname entity.  To this node, we need to add the BehaviorInBulkEditForm attribute.

<event name="onload" application="false" active="true" BehaviorInBulkEditForm="Enabled">

  • Enabled - If this is an event related to a field (onchange), then the field will be enabled.  The script will run.
  • EnabledButNoRender - If this is an event related to a field (onchange), then the field will be enabled.  However, the script will not run.
  • Disabled - (default) If this is an event related to a field, then that field will be disabled.  The script will not run.


Official knowledge base article:  http://support.microsoft.com/kb/949941