Community
Showing results for 
Search instead for 
Do you mean 
Reply

Access the CurrentLookupContactList

Accepted Solution Solved
New Member
Posts: 6
Country: United_Kingdom
Accepted Solution

Access the CurrentLookupContactList

Hi,

 

I am attempting to develop my own framework application that needs to read the current lookup in ACT and I cannot seem to get it to work.

I've built a small VB application that has options to lookup the complete contact list or the current lookup. The complete contact list works fine but I cannot get the current lookup to work.

 

Please can someone help, this is driving me insane. I have scoured this message board but have only found references to an older version of ACT that doesn't work.

 

Many thanks

 

Jon


Accepted Solutions
Solution
Accepted by topic author jonwilliamsifg
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Access the CurrentLookupContactList

The ACTAPP is oly available if you are a plugin. It will ne null if you are standalone.

 

Check out this post but remove the references to the ACTAPP

http://community.act.com/t5/ACT-Developer-s-Forum/Get-Contact-using-Lastname-firstname-as-filter-cri...

 

 

   'Perform Lookup         

Dim cColumn3 As CriteriaColumn        

Dim cColumn1 As CriteriaColumn         

Dim cColumn2 As CriteriaColumn         

Dim oOperator1 As OperatorEnum         

Dim sValue3 As String         

Dim sValue1 As String         

Dim sValue2 As String         

Dim cLookup As ContactLookup         

Dim cList As ContactList

 

 'initialize some varables         
oOperator1 OperatorEnum.EqualTo
 
'Cust ID
sValue1 txtCustomerID.Text.ToString         'Company Name 
sValue2 txtCustomerName.Text.ToString         'Phone Number 
sValue3 txtPhone.Text.ToString
'Get the column(s) to lookup on        
cColumn1 ActFwk.Lookups.GetCriteriaColumn("TBL_CONTACT""USER10"true) cColumn2 ActFwk.Lookups.GetCriteriaColumn("TBL_CONTACT""COMPANYNAME"true
cColumn3 ActFwk.Lookups.GetCriteriaColumn("TBL_ADDRESS""LINE1"true)
 
'Create an array to hold all of the lookup criteria        
 Dim lCriteria() As Criteria = New Criteria() {New Criteria(LogicalOperator.OrCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue1), New Criteria(LogicalOperator.OrCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue2), New Criteria(LogicalOperator.EndCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue3)}
 
'Create the Lookup          
cLookup ActFwk.Lookups.LookupContactsReplace(lCriteria, truetrue)
 'Set our contact list to the lookup         
cList cLookup.GetContacts(Nothing)
 
Hope this helps
-- Jim Durkin

View solution in original post


All Replies
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Access the CurrentLookupContactList

Can you post the example which did not work. The SDK Lookup has not really changed in many version, ( if at all...)

 

The older examples from way back should still work.

 

-- Jim Durkin

New Member
Posts: 6
Country: United_Kingdom

Re: Access the CurrentLookupContactList

Hi Jim

 

See below

 

Dim CurList As ContactList = ActApp.ApplicationState.CurrentContactList
 Dim i As Integer = 0
 Dim LeCount As Integer = CurList.Count
 Dim SimpleContactList
 For i = 1 To LeCount
  SimpleContactList = SimpleContactList & CurList.Item(i - 1).FullName
  SimpleContactList = SimpleContactList & vbCrLf
 Next
 MsgBox(SimpleContactList)

 

the ActApp bit is not recognised in visual studio

Solution
Accepted by topic author jonwilliamsifg
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Access the CurrentLookupContactList

The ACTAPP is oly available if you are a plugin. It will ne null if you are standalone.

 

Check out this post but remove the references to the ACTAPP

http://community.act.com/t5/ACT-Developer-s-Forum/Get-Contact-using-Lastname-firstname-as-filter-cri...

 

 

   'Perform Lookup         

Dim cColumn3 As CriteriaColumn        

Dim cColumn1 As CriteriaColumn         

Dim cColumn2 As CriteriaColumn         

Dim oOperator1 As OperatorEnum         

Dim sValue3 As String         

Dim sValue1 As String         

Dim sValue2 As String         

Dim cLookup As ContactLookup         

Dim cList As ContactList

 

 'initialize some varables         
oOperator1 OperatorEnum.EqualTo
 
'Cust ID
sValue1 txtCustomerID.Text.ToString         'Company Name 
sValue2 txtCustomerName.Text.ToString         'Phone Number 
sValue3 txtPhone.Text.ToString
'Get the column(s) to lookup on        
cColumn1 ActFwk.Lookups.GetCriteriaColumn("TBL_CONTACT""USER10"true) cColumn2 ActFwk.Lookups.GetCriteriaColumn("TBL_CONTACT""COMPANYNAME"true
cColumn3 ActFwk.Lookups.GetCriteriaColumn("TBL_ADDRESS""LINE1"true)
 
'Create an array to hold all of the lookup criteria        
 Dim lCriteria() As Criteria = New Criteria() {New Criteria(LogicalOperator.OrCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue1), New Criteria(LogicalOperator.OrCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue2), New Criteria(LogicalOperator.EndCType(0,Byte), CType(0,Byte), cColumn1, oOperator1, sValue3)}
 
'Create the Lookup          
cLookup ActFwk.Lookups.LookupContactsReplace(lCriteria, truetrue)
 'Set our contact list to the lookup         
cList cLookup.GetContacts(Nothing)
 
Hope this helps
-- Jim Durkin
New Member
Posts: 6
Country: United_Kingdom

Re: Access the CurrentLookupContactList

Thanks, Jim. I got your email too.
New Member
Posts: 6
Country: United_Kingdom

Re: Access the CurrentLookupContactList

Hi Jim,

ActFwk is not recognised. I've changed it to Actframework but then I get the error that GetCriteriaColumn is not a member of Lookups

Can you help me a bit more please?

Jon
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Access the CurrentLookupContactList

Can you post your complete code example?

 

Thanks

-- Jim

Employee
Posts: 1,163
Country: USA

Re: Access the CurrentLookupContactList

My guess based on the exceptions you're now getting is that you've not instantiated your own ActFramework object.

 

ActFramework ActFwk= new ActFramework();

 

and then logon

 

ActFwk.LogOn(username, password, padFile);

 

 

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 6
Country: United_Kingdom

Re: Access the CurrentLookupContactList

Thanks, I'll try that.