Community
Showing results for 
Search instead for 
Do you mean 
Reply

get Selected Companies from Company List

Nickel Elite Contributor
Posts: 508
Country: USA

get Selected Companies from Company List

From the default Company List view, I would like to select one or more companies, then lookup those selected.  I cannot seem to just "get" the selected ones.  I have tried a few things from the CompanyList Class, like thinking the TaggedItems propery would reflect "selected", and additionally from the iProvideSelectedCompanies Interface, which had this example:

 

Dim instance As IProvideSelectedCompanies Dim value As CompanyList value = instance.GetSelectedCompanies()

 

Anyway, any help on getting the selected would be most helpful.  Thanks...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Super Contributor
Posts: 441
Country: UK

Re: get Selected Companies from Company List

Hi Richard,

Basically the only way I have found it is to do the following.... unfortunatly I don't have any visual studio available at the moment so I can only give you basic steps.  If you still get stuck drop me an email to my personal email address (the hotmail one) and I'll try and knock something up for you.

 

1. Check you are in the list view

2. Cycle the controls in actapp or the current view until you find the grid (I'm sure I've posted a couple of samples on here before if you get stuck)

3. Use the selected items property on the grid to get the selected items.

4. Get the company id for each row from the data bindings property and add them to an array

5. Use the get companies by id function

 

Good luck.

 

Tom

Nickel Elite Contributor
Posts: 508
Country: USA

Re: get Selected Companies from Company List

Tom -

 

Thanks, I did figure out 1-4, the view was not called the same as (for example) the ITaskView, which is a C1.FlexGrid.  It's an ActFlexGrid (which is cast to a C1FlexGrid), it just took me a while to figure it out.

 

Now, regarding step 5, I can select the companies (GetCompaniesByID(Nothing, cGuidArray), but am working on actually changing the view - i.e. actually doing the lookup, not just "getting" the companies.

 

Thanks for the insight on the loop, I did forget I had used that in another program...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Super Contributor
Posts: 441
Country: UK

Re: get Selected Companies from Company List

Hi Richard,

Glad its getting there... once you have the companies in a company list you can just set it using actapp.applicationstate.currentcompanylist = clist then actapp.uicompanymanager.showlistview or maybe just actapp.refreshloadedviews if youre already in the list view.  Not sure which you need but have a play and see which one works best.

 

Sorry if the properties above are wrong, they're close to that just got nothing to reference today.

 

Tom