Community
Showing results for 
Search instead for 
Do you mean 
Reply

Company Lookup

Accepted Solution Solved
Nickel Elite Contributor
Posts: 508
Country: USA
Accepted Solution

Company Lookup

Using code I borrowed from another post, I'm trying to run a company lookup (from a console app).  I'm getting an exception that does not make sense.  Here's [part of] the code:

 

    cpyList = ActFwk.Companies.GetCompanies(Nothing)

    For i As Integer = 0 To cpyList.Count - 1
      xCompany = cpyList(i)
      oValue1 = cField1.GetValue(xCompany) & vbNullString
      oValue2 = cField2.GetValue(xCompany)
      If Not (oValue2 Is Nothing) Then
        Console.WriteLine("Current Company info: " & oValue1.ToString & " | " & oValue2.ToString)
        'use Value2 to Lookup Parent Company via Field1
        Dim lookup As CompanyLookup
        Try
          lookup = ActFwk.Lookups.LookupCompaniesReplace(oValue2, OperatorEnum.EqualTo, cField1)
          'Dim cpyLookupList As CompanyList = lookup.GetCompanies(Nothing)
...and so on...

 I'm fairly certain it's the lookup that's failing, and here's the error message:

 

Unhandled Exception: System.MissingMethodException: Method not found: 'Act.Frame
work.Lookups.CompanyLookup Act.Framework.Lookups.LookupManager.LookupCompaniesRe
place(System.Object, Act.Framework.Lookups.OperatorEnum, Act.Framework.Companies
.CompanyFieldDescriptor)'.
at ACT_Console.Module1.Main()
Press any key to continue . . .

 

Thanks for any help, hopefully it's something simple...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com

Accepted Solutions
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Company Lookup

This works fine for me in 14, I'm not sure at this point if it's an issue with the version of the assemblies being used, are you able to use version 12 (or newer) references?

 

My other thought is that the LookupCompaniesReplace/Narrow actually returns ICompanySource; the statement used to fetch the companies. Here we're assigning it to a CompanyList. In 14, it threw an exception, there is a cast available but no need since LookupCompaniesX has a .GetCompanies method that returns an actual list.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Company Lookup

What version? Does LookupNarrow produce the same results?

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Company Lookup

References are 11.1.183, but logging on (via console app, not plugin) to a 14.0.572.0, Hot Fix 2 database.

 

Yes, same error with LookupCompaniesNarrow (well, same error, but error text specific to "Narrow")

 

Thanks...

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Company Lookup

Also, if there's an alternative method of lookup up I'm OK with that.  Basically, I need to use value of one field and lookup on the second field. Thanks... 

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com
Solution
Accepted by topic author rbrust
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Company Lookup

This works fine for me in 14, I'm not sure at this point if it's an issue with the version of the assemblies being used, are you able to use version 12 (or newer) references?

 

My other thought is that the LookupCompaniesReplace/Narrow actually returns ICompanySource; the statement used to fetch the companies. Here we're assigning it to a CompanyList. In 14, it threw an exception, there is a cast available but no need since LookupCompaniesX has a .GetCompanies method that returns an actual list.

Matthew Wood
Act! SDK Support
Community Moderator
Nickel Elite Contributor
Posts: 508
Country: USA

Re: Company Lookup

Changing References to v14 worked just fine - thanks again!!!

Richard Brust
ACT! Certified Consultant
richard@rbrDataSolutions.com