0
votes

I am new to Dynamics CRM and I could not find any information so far that would apply to my scenario. We have a Program entity that can have/reference multiple program dates entities, and each program date can have/reference multiple event entities. We have a view displaying all events associated with the program, and on the program form we want to display in a text the total number of events. From the view user can select multiple events then click delete button. This is a button that comes with CRM, not a custom one.

If I create a plugin for Delete message on event entity and want to query both program and Program date filed that keeps the total number of events then subtract one I am not sure these plugins will execute in sequence or concurrently thus having a race condition.

Now using javascript I also do not know if it is possible to read entity records PK and hook up into the pop up Confirm Deletion dialog box and execute after that a web service call

Any ideas?

Thanks Dan

1

1 Answers

0
votes

The deletes will process synchronously for the current user, but there is nothing that is preventing another user from performing deletes on Events that are also associated to the Program.

One option that you could look at is creating a flag on the Program and Program Date entities called "Events Deleted". Then create another plugin on the read that checks to see if it's "Events Deleted" flag has been flipped, and if so, recalculates the value, updates it and clears it's flag so it doesn't get calculated again.