Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: RE: How to use preImage and postImage in Plugins

$
0
0
Thank you for replying. @Guido I wrote the following, is it correct? How can I trigger the plugin as post sync, do you mean that I should register it as post-operation? var targetEntity = context.GetTarget(); var preImage = context.GetPreImage(); if (targetEntity == null) return; var postImage = preImage.Merge(target); if (!postImage.Contains("title")) throw new InvalidPluginExecutionException(OperationStatus.Failed, "Title is empty!"); if (!postImage.Contains("year")) throw new InvalidPluginExecutionException(OperationStatus.Failed, "Year is empty!");

Viewing all articles
Browse latest Browse all 154803

Trending Articles