I have this issue with a plugin im working on and I'm running out of ideas.
This is a plugin registered on:
Message: Delete
Primary Entity: Account
Secondary Entity: None
Pre-Operation (Already tried it on Post-Operation)
Execution Mode: Synchronous
Basically, I need to read the values of the record using the pre image. The preimage have a certain amount of field, not all the available ones.
I'm using:
Entity recordBefore = (Entity)context.PreEntityImages["preImage"];
foreach (KeyValuePair<String, Object> attribute in recordBefore.Attributes)
{
/*Read each field and do something*/
tracingService.Trace("Key:{0}, Value:{1}", attribute.Key, attribute.Value);
}
However, the "recordBefore" entity is incomplete. I have selected in my preimage a lot of the "address1_xxx" fields and none of them is coming in the preimage. Its also happening with other fields, custom and not custom ones and all of different data types.
Any idea of why is this happening? If I select all the field in the preImage, I get a lot of field.. but not all of them and def. not the "address1_" ones.