Answered by:
The plugin caller

Question
-
Hi all,
I have a plugin that use the crm web service to update another entity;s field. The problem is that this field can be modified from 2 different sources (2 plugins).
Is there a way to identify the caller plugin inside of a plugin?
Thanks!
Friday, August 20, 2010 10:03 AM
Answers
-
You will have to use the SharedVariables to pass some info around between plugins. http://msdn.microsoft.com/en-us/library/bb959596.aspx
MSCRM Bing'd - http://bingsoft.wordpress.com- Marked as answer by Donna EdwardsMVP Monday, August 23, 2010 3:34 PM
Friday, August 20, 2010 12:41 PMModerator -
yes, just add a String value to the SharedVariables similar tothis http://msdn.microsoft.com/en-us/library/cc151094.aspx in your first plugin and then retreive the value in your second plugin.
MSCRM Bing'd - http://bingsoft.wordpress.com- Proposed as answer by RhettClintonMVP, Moderator Friday, August 20, 2010 12:56 PM
- Edited by RhettClintonMVP, Moderator Friday, August 20, 2010 3:35 PM
- Marked as answer by Donna EdwardsMVP Monday, August 23, 2010 3:34 PM
Friday, August 20, 2010 12:56 PMModerator
All replies
-
you can get called used id from context.UserId or context.InitiatingUserId
Hope this helps..
MayankP My Blog My twitterFriday, August 20, 2010 10:31 AMAnswerer -
What i meant in my question is , if inside a plugin i make an update that fire another plugin, how can i identify the plugin that make the update inside the plugin that was executed when the update occured.
Friday, August 20, 2010 12:09 PM -
I think you should be able to get if through Collerorigin if it's equal to "WebServiceApi" on context
Mahain : http://mahenderpal.wordpress.comFriday, August 20, 2010 12:28 PMModerator -
Yes, but the update call can came from 2 different sources (2 different plugins) and i want to be able to find what is the exactly plugin that made the update. I want to find his type or other identifications, maybe the primary entity name or smtg.Friday, August 20, 2010 12:34 PM
-
You will have to use the SharedVariables to pass some info around between plugins. http://msdn.microsoft.com/en-us/library/bb959596.aspx
MSCRM Bing'd - http://bingsoft.wordpress.com- Marked as answer by Donna EdwardsMVP Monday, August 23, 2010 3:34 PM
Friday, August 20, 2010 12:41 PMModerator -
I nedd the type of the plugin that make the update through the web service.Friday, August 20, 2010 12:46 PM
-
yes, just add a String value to the SharedVariables similar tothis http://msdn.microsoft.com/en-us/library/cc151094.aspx in your first plugin and then retreive the value in your second plugin.
MSCRM Bing'd - http://bingsoft.wordpress.com- Proposed as answer by RhettClintonMVP, Moderator Friday, August 20, 2010 12:56 PM
- Edited by RhettClintonMVP, Moderator Friday, August 20, 2010 3:35 PM
- Marked as answer by Donna EdwardsMVP Monday, August 23, 2010 3:34 PM
Friday, August 20, 2010 12:56 PMModerator -
Yes, I am agree with Rhett, you can use sharevariable to pass data between plugin, in your plugin store some value in shared variable and in other plugin check if this value present or not, if it is present it means the earlier plugin has fired already.
Mahain : http://mahenderpal.wordpress.com- Proposed as answer by HIMBAPModerator Friday, August 20, 2010 1:57 PM
Friday, August 20, 2010 1:57 PMModerator