Showing results for 
Search instead for 
Do you mean 

How to lookup Disvisions (Sub Company) in Comapny

New Member
Posts: 1
Country: India

How to lookup Disvisions (Sub Company) in Comapny

I am facing a problem to include the SubCompany in the Lookup List. When you open the Company Lookup Dialog you can see there is a checkbox to include Divisions Also in the lookup. I want to do the same lookup through Program. Please see my code below. How to include the Divisions (subCompany) in the Lookup?


Dim lk As Act.Framework.Lookups.CompanyLookup           

Dim fdRecMgr AsCompanyFieldDescriptor = GetCompanyFieldDescriptor("record manager")


Dim cList AsCompanyList

Dim currentUserContact AsContact = _


Nothing, NewGuid() {NewGuid(actApp.ActFramework.CurrentUser.MyRecord.ToString)})(0)


lk = actApp.ActFramework.Lookups.LookupCompaniesReplace(currentUserContact.FullName, Act.Framework.Lookups.

OperatorEnum.EqualTo, fdRecMgr)


cList = lk.GetCompanies(Nothing)


If cList.Count > 0 Then

                actApp.UILookupManager.LookupCompanies(lk, False)


End If


Posts: 1,163
Country: USA

Re: How to lookup Disvisions (Sub Company) in Comapny

Hello Sunden,


I did the same as you, with basically identical code (except in c# instead of vb) and my lookups always included divisions and their parent company. 


CompanyLookup cLook;
CompanyLookup cLook2;
CompanyFieldDescriptor compState = _ActApp.ActFramework.Companies.GetCompanyFieldDescriptor("TBL_COMPANY.BUSINESS_STATE");
CompanyFieldDescriptor compRecordMgr =_ActApp.ActFramework.Companies.GetCompanyFieldDescriptor("TBL_COMPANY.MANAGERUSERNAME");


CompanyList cList;
CompanyList cList2;
cLook = _ActApp.ActFramework.Lookups.LookupCompaniesReplace("GA", OperatorEnum.EqualTo, compState);
cLook2 = _ActApp.ActFramework.Lookups.LookupCompaniesReplace("Allison Mikola", OperatorEnum.EqualTo,compRecordMgr);

cList = cLook.GetCompanies(null);
cList2 = cLook2.GetCompanies(null);


//_ActApp.UILookupManager.LookupCompanies(cLook, false);
_ActApp.UILookupManager.LookupCompanies(cLook2, false);

Matthew Wood
Act! SDK Support
Community Moderator