Messages : Delete
Event Pipeline Stage of Execution : Pre-Validation
Pre Image pre image under step
public class DeletePlugin: IPlugin { public void Execute(IServiceProvider serviceProvider) { //Extract the tracing service for use in debugging sandboxed plug-ins. ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService)); IPluginExecutionContext context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext)); // The InputParameters collection contains all the data passed in the message request. if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) { Entity entity = (Entity)context.InputParameters["Target"];
tracingService.Trace(" exists ");
if (entity.LogicalName != "contact")
try {
if (context.PreEntityImages != null && context.PreEntityImages.Contains("PreImage")) {
Entity BeforeDeleteEntity = (Entity)context.PreEntityImages["PreImage"];
} }
catch (FaultException<OrganizationServiceFault> ex) {
throw new InvalidPluginExecutionException("An error occurred in the FollowupPlugin plug-in.", ex);
}
catch (Exception ex) {
tracingService.Trace("FollowupPlugin: {0}", ex.ToString()); throw; }
}
else{
tracingService.Trace("not exists ");
}
} }
Result is not exists
I would like to get entity fileds
*This post is locked for comments