Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Plugin fired once but function is fired twice

$
0
0

So I have this entity that has one step the create step. This step calls a function to update other entities' cost value. The issue is when I create the entity it in fact doubles the amount it is suppose to add/subtract on the other related entities. So for example if the given value is 50 the result ends up being a subtraction of 100. I know the plugin is only fired once due to the log file. The function is fired twice. I know this because I had placed a crm log statement in  the function and it gets logged twice. Interesting note both log files shows a different parent context. One shows the sandboxExecutioncontext as a parent the other has a pluginexecutioncontext as an xml file as the parent context. I have already checked the update steps on the other entities. The other entities' update don't end up modifying the math operation again. I've stepped through the code on the create function and the value being used there is correct. Every time I run the debug through the function the resulting entities do show the correct math value. 

In the end what happens is that when i create the entity with a value of say 50. It should modify another entity and subtract 50 from it. The issue is that it instead subtracts 100. I'm under the belief that just the function is called twice due to an error log file. I've searched throughout the entire solution and the function is only called once in the create step for the plugin. 


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>