Community
Showing results for 
Search instead for 
Do you mean 
Reply

Company deleted event

Copper Contributor
Posts: 119
Country: USA

Company deleted event

by russell.jones on 01-16-2008 5:59 AM
 

Hi,

 

How do i know when a company has been deleted?  I've had a good search through the object browser for some kind of company deleted method but I can't seem to see anything.

 Regards,

 

Russell

 
Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by Vivek on 01-18-2008 7:51 AM

Hi Russell,

I was wiondering have you tried checking for the entity enum value of a company?

if(oCompany.State==Act.Framework.EnityState.Deleted){//do stuff;}

Now obviously that will only work whilst you actually still have the Company object in memory and before the dB does a commit, otherwise I agree with you I don't think that there is a specific event handle for a deleteion. I could be wrong though! Smiley Surprised)

Vivek

Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by russell.jones on 01-18-2008 8:06 AM

Thanks for that.

 I really wanted to know when someone had deleted a company in the UI so that I can remove the information I am storing about that company from my application.  I've programmed it so that when i look at a company in my application it checks to see if it is still present in Act and deletes it if it's not.  That doesn't seem like the cleanest option though but It'll have to do if there's not an event to hook into.

 

Russell
 

Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by Mark on 01-18-2008 12:08 PM

DataList the base class for CompanyList has Removing and RemoveComplete events you can sign up for.

 

Mark 

Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by russell.jones on 01-18-2008 12:14 PM

brilliant, thank you.

 

It's the weekend here now so I'll take a look on monday morning.

Thanks again, Russell 

Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by russell.jones on 01-22-2008 7:58 AM

I'm still lost on this.

How do I get the underlying CompanyList of all companies in ACT!? 

I've tried using Framework.Companies.GetCompanies(null); and the event fires if i remove a company from the list returned but it doesn't fire if i remove the company from ACT! via the GUI.

Thanks,

Russell

Copper Contributor
Posts: 119
Country: USA

Re: Company deleted event

by Mark on 01-22-2008 12:09 PM

You can get the current company detail view list from ActApplication.ApplicationState.CurrentCompanyDetailList.

You need to sign up for the event on the list that is being used by the application for the delete.