Community
Showing results for 
Search instead for 
Do you mean 
Reply

CurrentContactChanged

Copper Super Contributor
Posts: 478
Country: Australia

CurrentContactChanged

 

Does any one know why this code would be launched 3 times?

 

I open the contact record and the message pops up 3 times right after each other, does that mean the code runs 3 times? or am i using the wrong launch event?

 

        void oApp_CurrentContactChanged(object sender, EventArgs e)
        {
.
.
.
.
.
.
.
.


            if (modifiedtime1.Date <= checktime.Date)
            {
               countHistories(null);
               MessageBox.Show("Count History function has fired and been calculated\n\nLast Edit Date is " + EditValueS + ".", oApp.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Count History function has not fired\n\nLast Edit Date is " + EditValueS + ".", oApp.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        
        }

 

 


Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6
Silver Super Contributor
Posts: 2,328
Country: USA

Re: CurrentContactChanged

It runs 3 times but only when you first open the database.  After that it only fires once when the Contact is changed.  I haven't tested that in a while but it would have broken a few of my apps if it didn't still work that way.  You can remove the event handler the first time through the routine and put it back later or you can compensate for the first 3 times through.

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
Copper Super Contributor
Posts: 478
Country: Australia

Re: CurrentContactChanged

Thanks wellmet, as long as its normal i was worried the code was looping 3 times mine happens every time i open a client record

Jason Dawson Financial Planning
Brisbane | Australia - JDFP Home Page

Act Ver - Act! Premium Version 17.1.169.0, Hot Fix 3
OS - Windows 7 (stand alone machine)
MS Office - Enterprise 2007
Phone - Samsung Galaxy s6