Hi guys,
i have strange bug with plugin (only in sandbox mode):
1. load current entity from DB
2. mix attributes loaded entity and current entity in current entity
foreach (KeyValuePair<string, object> attr in secondaryEntity.Attributes) {string key = attr.Key;if (!mainEntity.Attributes.ContainsKey(key)) {object value = attr.Value;//if (value is EntityCollection) mainEntity.Attributes[key] = value; } }
after work of plugin the system generations an exception:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Runtime.Serialization.SerializationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #31550DA4Detail: <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" /><Message>System.Runtime.Serialization.SerializationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #31550DA4</Message><Timestamp>2011-10-10T09:25:54.6595704Z</Timestamp><InnerFault i:nil="true" /><TraceText> [CDMBase.Plugins: CDMCRM11.Appointment_Update_Pre_SetPromotionStatus] [32caaa30-e5e9-e011-9fb1-000c29b30c2d: Appointment_Update_Pre_SetPromotionStatus] </TraceText></OrganizationServiceFault>
it only happens when there are fields of type 'EntityCollection' ( in 'appointment' case they are requiredattendees, optionalattendees, organizer)
What do you think about this?
Thanks in advance