Community
Showing results for 
Search instead for 
Do you mean 
Reply

Is there a way to programmatically retreve the items of the "Country" dropdown list field

Accepted Solution Solved
Copper Contributor
Posts: 16
Country: New Zealand
Accepted Solution

Is there a way to programmatically retreve the items of the "Country" dropdown list field

I have an existing customers table containing all customers details. I want to programmatically enter them into ACT!. But there's a small problem, the country field in my customers table could be different (incorrect spell, different case, slightly different name) from the ones in the country dropdown list in ACT!, But ACT will allow those records anyway, and this is not desired as I don't want to have a country named "New Zeala" when there is already  a "New Zealand" item in the list.  

 

So what I need is either entering a defined country, or nothing gets entered. Is there a way to retrieve the list items for comparison?

 

Thanks


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

Re: Is there a way to programmatically retreve the items of the "Country" dropdown list field

You can read all the items in the picklist using the GetPickList method.

 

Dim pickList As Act.Framework.PickLists.PickList

pickList = HostFramework.PickLists.GetPickLists("PickListName")

For Each PickListItem As Act.Framework.PickLists.PickListItem In pickList.Items

    ' Get the String value of the PickListItem

     Dim value As String = PickListItem.Value.ToString()

Next

 

Hope this helps

-- Jim Durkin

 

View solution in original post


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

Re: Is there a way to programmatically retreve the items of the "Country" dropdown list field

You can read all the items in the picklist using the GetPickList method.

 

Dim pickList As Act.Framework.PickLists.PickList

pickList = HostFramework.PickLists.GetPickLists("PickListName")

For Each PickListItem As Act.Framework.PickLists.PickListItem In pickList.Items

    ' Get the String value of the PickListItem

     Dim value As String = PickListItem.Value.ToString()

Next

 

Hope this helps

-- Jim Durkin

 

Bronze Elite Contributor
Posts: 1,409
Country: United_Kingdom

Re: Is there a way to programmatically retreve the items of the "Country" dropdown list field

Hi, If I understand correctly this may help you. Why not import and then correct as follows -

 

Import contact data as normal BUT import the COUNTRY data in to one of the act USER fields.

Change the contact view so that the USER field is viewable in the top half of the screen.

Now you can populate the COUNTRY field with the correct entry.

 

If you do want to get a list of all the Country Field Drop Down options without writing code simply go to

 

TOOLS

DEFINE FIELDS

Select MANAGE DROP_DOWN LISTS

Select COUNTRIES

Select NEXT

Select EXPORT DROP_DOWN LIST ITEMS

Save so you can view in Excel etc

 

Hope this helps.