Community
Showing results for 
Search instead for 
Do you mean 
Reply

Show CompanyLookup for given IDs / CompanyList

Copper Contributor
Posts: 96
Country: Netherlands

Show CompanyLookup for given IDs / CompanyList

Hi all,

 

How can I make a company lookup in Act! For a given set of Company ID’s?

 

For contacts I can do this:

 

actApp.UILookupManager.LookupContacts(cl); // cl being a ContactList

 

 

For companies there isn’t a LookupContacts with a CompanyList parameter. Lookup by criteria doesn’t allow me to use the COMPANYID column:

 

 

MutableEntityFieldDescriptor desc_ID = ACTFM.Contacts.GetFieldDescriptor("TBL_COMPANY.COMPANYID", true);
CriteriaColumn col_ID = ACTFM.Lookups.GetCriteriaColumn(desc_ID);
Criteria crit_ID = new Criteria(Act.Framework.Lookups.LogicalOperator.Or, 0, 0, col_ID, OperatorEnum.EqualTo, ValueEnum.True);
crits.Add(crit_ID);

How can I best achieve this? I’d rather not do a lookup with hundreds of OR’s based on Company Name…

 

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands
Copper Elite Contributor
Posts: 85
Country: Canada

Re: Show CompanyLookup for given IDs / CompanyList

Not sure if there is a better way but i do it like this (snippet below):

 

                    var lstRecords = _actApp.ActFramework.Companies.GetCompaniesByID(new SortCriteria[] { }, lstRecordIDs.ToArray());


                        _actApp.ApplicationState.CurrentCompanyList = lstRecords;

                        if (lstRecords.Count > 1)
                            _actApp.UICompanyManager.ShowListView();
                        else
                        {
                            _actApp.UICompanyManager.ShowCompany(lstRecords[0]);
                            _actApp.UICompanyManager.ShowDetailView();
                        }
Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca