08-23-2011 08:01 PM
I have a simple plugin that performs a task when the user creates a new opportunity. All it does is populate a couple of fields and update the contact. I've run into an issue I can't seem to find a workaround for.
When the user duplicates the current contact (using either the primary field or all fields option), the .AddNewComplete event fires right away and the plugin fills in it's fields... BUT apparently the plugin gets in the way of the "duplication" and I end up with a new contact with no (primary or otherwise) fields duplicated but with the fields the plugin populates neatly done.
So... I figure (after talking to Stan "The Wise") that either I need to wait for the duplication process to finish before I update or I need to somehow detect when a duplicate contact command is issued.
Anybody have any thoughts? I would be happy to share my current code if that will help.
Scott Holmes
Cornerstone Solutions, Inc.
08-24-2011 05:48 AM
There isn't a way to intercept the window and there isn't an event that posts when a contact duplication occurrs. One idea might be to implement your own contact duplication, the DuplicateContact method is useable through the SDK, so you could replace the existing one and that'd make it possible for your to execute the event in the order you want.
Or, it may complicate the code significantly, but would it be possible to handle your field population in a seperate thread?