05-29-2008 08:33 AM
Hi,
I'm trying to develop a plugin that will update the contact in a third party software. I can't find which event I need to trap for that !
In the AfterLogon event of my plugin, i'm trying this code :
AddHandler MyActApp.ApplicationState.CurrentContact.Updated, AddressOf ContactUpdated
but the sub "ContactUpdated" never fired...
Please help !
Thanks in advance
Yves
05-29-2008 04:06 PM
Hiya,
Try placing the handler within the ViewLoaded event it should work then.
HTH,
Vivek
05-30-2008 02:29 AM
Hi Yves,
I always use the current contact changing and current contact changed events.
When the current contact is changed you need to add the contact updated event to the current contact.
When the current contact is changing you need to remove the contact updated event from the current contact.
Hope that makes some sense
Tom
06-03-2008 11:19 PM
Your comments are a good start.
Some code would be even better.
06-04-2008 01:38 AM
Just for you ...
Private Sub ActApp_AfterLogon(ByVal Sender As Object, ByVal e As System.EventArgs) 'trap the contact changing and changed events AddHandler ActApp.CurrentContactChanging, AddressOf CurrentContactChanging AddHandler ActApp.CurrentContactChanged, AddressOf CurrentContactChanged End Sub 'ActApp_AfterLogon Private Sub CurrentContactChanging() 'contact is changing so remove the contact updated event for this contact RemoveHandler ActApp.ApplicationState.CurrentContact.Updated, AddressOf ContactUpdated End Sub Private Sub CurrentContactChanged() 'the contact has changed so trap the contact updated event AddHandler ActApp.ApplicationState.CurrentContact.Updated, AddressOf ContactUpdated End Sub Private Sub ContactUpdated() 'do stuff for your contact updated event here End Sub
06-05-2008 12:12 AM
Thanks for the code.
1. This works on Create and Update but contact.State is always "Unchanged".
2. It does not work on Delete.
3. Do you need to put the remove of the event handler in a try block in case the event handler is not there?
06-11-2008 01:57 AM
1. I have never used the contact.State property sorry.
2. This event only fires when a contact is saved, I'm not sure how you'd trap a contact deleted event.
3. You could do but it does fall over gracefully without it.
09-15-2008 12:11 PM
12-21-2009 12:06 PM
Does anyone have an example of trapping a contact being deleted? As mentioned, contact.State seems useless for detecting this event.
Since this post is over a year old I'm hopeful someone out there has worked this one out by now.
TIA
01-12-2010 07:15 PM
Hello,
I'm looking for some help with an issue I'm having while developing a plug-in for ACT! 2009. I need to trap the three basic contact events from ACT!: contact created, changed or deleted. Using CurrentContact.Updated I'm able to detect when a contact is created and updated but not when it is deleted. I've tried using .EntityState to determine the state of the contact but it never changes. Is there some special method or technique I'm missing? Any help would be greatly appreciated.
Thank you,
jmb