Community
Showing results for 
Search instead for 
Do you mean 
Reply

FieldChanged doesn't fire

Nickel Super Contributor
Posts: 352
Country: Canada

FieldChanged doesn't fire

Hi All,
 
I'm using the FieldChanged event by adding event handlers for CurrentContactChanging and CurrentContact changed and it works fine except the FieldChanged event doesn't seem to fire for the first contact loaded.  Even though the CCChanging and CCChanged fire (twice even) when the first contact loads, FieldChanged doesn't take.
 
Here'e the relevant parts of the code - any ideas?
 
  public void OnLoad(ActApplication passedApp)
  {
   ACTAPP = passedApp;
    ACTAPP.CurrentContactChanging += new EventHandler(ACTAPP_CurrentContactChanging);
    ACTAPP.CurrentContactChanged += new EventHandler(ACTAPP_CurrentContactChanged);
  }
 
void ACTAPP_CurrentContactChanged(object sender, EventArgs e)
        {
            ACTAPP.ApplicationState.CurrentContact.Fields.FieldChanged += new Act.Framework.MutableEntities.MutableEntity.FieldCollection.FieldChangedHandler(Fields_FieldChanged);
        }
 
void ACTAPP_CurrentContactChanging(object sender, EventArgs e)
        {
            try
            {
                ACTAPP.ApplicationState.CurrentContact.Fields.FieldChanged -= Fields_FieldChanged;
            }
            catch (Exception ex)
            {
            }
        }
 
Thanks,
Len
Len Kamerman
ACT! Certified Consultant

Act E-mail Marketing Trainining Course:

http://actsoftware.training
Loyal Listener
Posts: 69
Country: United States

Re: FieldChanged doesn't fire

I have a similar issue. 

 

When I change the view from the Contact Detail to another view (Group List, Task List, whatever), then change the view back to the contact I was just on, the Field Change event no longers fires.

Nickel Super Contributor
Posts: 352
Country: Canada

Re: FieldChanged doesn't fire

Yeah, I haven't finished an application that relies on the event yet, so I can't say for certain, but I think what you have to do is remove and re-add the event each time the view changes.  Stan helped me with that.  My guess is it has something to do with redrawing the controls, but I don't know.
Len Kamerman
ACT! Certified Consultant

Act E-mail Marketing Trainining Course:

http://actsoftware.training
Loyal Listener
Posts: 69
Country: United States

Re: FieldChanged doesn't fire

[ Edited ]

This is what I tried, and it doesn't fire when you return to the Contact Detail from another view:

 

 Public Sub OnLoad(ByVal App As ActApplication) Implements IPlugin.OnLoad

ACTAPP = App 'Store a referenct to ActApplication

AddHandler ACTAPP.AfterLogon, AddressOf ACTAPP_AfterLogon

AddHandler ACTAPP.BeforeLogoff, AddressOf ACTAPP_BeforeLogoff

AddHandler ACTAPP.CurrentContactChanging, AddressOf ACTAPP_CurrentContactChanging

AddHandler ACTAPP.CurrentContactChanged, AddressOf ACTAPP_CurrentContactChanged

AddHandler ACTAPP.CurrentViewChanged, AddressOf ACTAPP_CurrentViewChanged

End Sub 'OnLoad

 

 

 Private Sub ACTAPP_CurrentViewChanged(ByVal sender As Object, ByVal e As EventArgs)

RemoveHandler ACTAPP.CurrentContactChanged, AddressOf ACTAPP_CurrentContactChanged

'   RemoveHandler ACTAPP.ApplicationState.CurrentContact.Fields.FieldChanged, AddressOf Fields_FieldChanged 'Tried this one too.

If ACTAPP.CurrentViewName = "Act.UI.IContactDetailView" Then

AddHandler ACTAPP.CurrentContactChanged, AddressOf ACTAPP_CurrentContactChanged

'   AddHandler ACTAPP.ApplicationState.CurrentContact.Fields.FieldChanged, AddressOf Fields_FieldChanged 'Tried this one too.

End If

End Sub

Message Edited by mfortier on 03-11-2010 06:14 AM
Message Edited by mfortier on 03-11-2010 06:16 AM
Copper Super Contributor
Posts: 59
Country: USA

Re: FieldChanged doesn't fire

Hi Guys, 

 

I'm also having the same issue for the first contact loaded when ACT loads. Field Changed even doesn't get fired. Did you guys ever find a solution?

 

Thanks in advance 

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Nickel Super Contributor
Posts: 352
Country: Canada

Re: FieldChanged doesn't fire

No, not at all.  Luckily (not sure if "luckily" is the right word, but it could be worse), since it's the my record, the expectation can be set that the functionality I'm developing does not work with user records.  It's not ideal though, by any means.
Len Kamerman
ACT! Certified Consultant

Act E-mail Marketing Trainining Course:

http://actsoftware.training
Copper Super Contributor
Posts: 59
Country: USA

Re: FieldChanged doesn't fire

I've found that the real issue is with fields on contact tabs or the my record field changes on load, like you pointed out. If the field is located in the contact detail view main window, I'm told the field change event works fine. However, this doesn't work for our products either. We need it to fire even on the tabs. I'm in contact with sdk staff and I'll post the workaround here when we figure it out.
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Copper Contributor
Posts: 11
Country: USA

Re: FieldChanged doesn't fire

I have been struggling with this issue for a couple of years. The issue is that Act goes to 'sleep' after a certain amount of time. Pressing F5 before changing the field will cause the field change event to trigger (go figger).

I saw on the Durkin sight that he has a program for Auto refresh:

http://durkincomputing.wordpress.com/2010/03/11/auto-refresh-add-on/

I'm not sure exactly what it does but I think it was created to solve this issue.

I am planning on creating a similar plugin at some point but until then....F5 is our friend.

John

Copper Contributor
Posts: 11
Country: USA

Re: FieldChanged doesn't fire

I forgot to mention it is a free download.
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: FieldChanged doesn't fire

[ Edited ]

Not only is the AutoFrefresh for ACT FREE but I have included the source code. After installing AutoRefresh a Visual Studio 2008 VB project is delivered in a zip file named "Durkin.Custom.AutoRefresh.zip" located in the "C:\Program Files\ACT\Act for Web\Plugins" or "C:\Program Files\ACT\Act for Windows\Plugins". 

 

 Other tools you can check out from us are: 

1) The SDK for the Durkin Toolkit which may help answer some questions on how we create ACT! add-on.  Our SDK requires one of our addons be installed such as: The Durkin Toolkit, Calendar View Plus, Task List Plus or Opportuinty List Plus. It uses ACT's SDK framework of couse but also allows developers to hook into additional events such as "New Entity Sub Item" and a new CurrentViewChanged event that included custom table views. Our SDK includes Visual Studio project templates to get you up and running fast.

 

 

After installing our SDK follow these steps to create a custom projectOur project template is a starting point for custom plug-ins.   

 

     1. Open Visual Studio 2008    

     2. Go to the FILE menu and select NEW PROJECT    

     3. In the “New Project” dialog select         

           “Durkin.Custom.SDKExamplesVB” ( Visual basic)         

           “Durkin.Custom.SDKExamplesCs” ( C Sharp ) 

 

2) The SDK for the Smart Notes for ACT. This SDK allows third party developers to create triggers to open sticky notes. This SDK requires Smart Notes for ACT be installed. Contact me directly and I can get you NFRs for any of our tools you need. 

 

 

Hope this helps. If you have any questions please contact me directly:

 

Thanks

-- Jim Durkin

 

Message Edited by jimdurkin on 05-01-2010 01:14 PM