Questions tagged [country-and-state]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10
votes
1answer
2k views

How to write Address.settings in order to implement Country Picklists via Metadata API (eclipse)?

In order to implement Country Picklists on standard address fields I'm following the documentation here: https://help.salesforce.com/HTViewHelpDoc?id=admin_state_country_picklists_overview.htm&...
9
votes
2answers
10k views

Country & State picklist as custom fields

Is the State and Country picklists available as custom fields? Can I define a custom field of type Country and use the 'built in' Country values?
9
votes
2answers
400 views

New BUG in Winter 19: We can't turn ON Country State Picklists on fresh new Orgs (Confirmed as Know Issue by Salesforce)

We turn on Country-State-Picklists on almost every Org we touch. Assume we act on a NEW and BLANK Org, just fresh spun DE (Developer Edition) Org. But it is the same on any Org and we have tried lots ...
6
votes
3answers
2k views

How to support State and Country picklists from same code that supports picklists disabled?

It would seem that it is not possible to support picklists enabled and picklists not enabled from the same Apex Code if we are writing to the State or Country. Consider the following: oAccount[0]...
5
votes
1answer
1k views

Are State and Country Picklist values enforced for data inserted through the API?

We are going to be turning on State/Country picklists soon for Leads and Accounts. There is currently a process for us in place that inserts new Leads using the SForce SOAP Api). Data that is ...
5
votes
1answer
239 views

How are State and Country Picklist values encoded/updated in the rendered page?

We have a bug where the state picklist does not update when the country picklist is changed in one page (with the feature working in other pages). There are no JavaScript errors in the console. To ...
4
votes
2answers
1k views

SFDX Country/State picklist on scratch org

When I create new scratch org I'm not able push code which uses country/state picklist. Following command: force:source:push give error for class: Variable does not exist: Account....
4
votes
1answer
3k views

How to present state and country picklists with dependency logic in a Lightning Component?

It's not too hard to present the Contact/Account state and country picklists themselves, but the dependency filtering where when you select "United States" as the country only the 50 or so relevant ...
4
votes
2answers
790 views

Can I reuse the dependency logic of State and Country picklists from Account/Contact in a Apex Classes?

I have enabled the State and Country picklists in Salesforce and I was trying to get/create the same kind of country and state picklist with dependency from Contact in a visual force page. I have ...
4
votes
2answers
672 views

Retrieve Translated country picklist values

I wanted a Metadata API to get the Spanish translations of Address Country picklist. Using Translations type or Address doesnt help me get the values.
4
votes
3answers
3k views

How do I delete unwanted values from the new State/Country picklists?

As an attempt to solve this problem, I've copied the various values in the standard country picklist field to a backup text field so we could go back and clean up later. Now I'm trying to delete all ...
3
votes
1answer
2k views

Best way to get city, state, and zip fields onto Account object?

The Account object doesn't have city, state, or zip standard fields. I can create those in custom fields, but feel like there should be a better way to do that? We want to be able to pull a report ...
3
votes
1answer
403 views

Automate creation of Salesforce states for countries

I would like users to be able to easily add new states to the state territory country picklist. See the picture We are an international business and it is not feasible to prefill out all the states ...
3
votes
1answer
751 views

Visualforce State and Country Picklists - Standard Fields

Question Can a Visualforce Page be built so it displays the actual picklist values and dependencies for fields which incorporate State and Country Picklists? I tried using Field Sets as well as hard-...
3
votes
2answers
2k views

Country and State picklist in apex

I want to check if state exists or not with a country in State and Country Picklist feature supported by Salesforce. I want to do this in Apex. How can I do this?
3
votes
1answer
55 views

Account History tracking shows codes instead of full names after enabling State/Country picklists

I'm seeing that changes made on an Account after we have enabled State & Country/Territory Picklists on our sandbox default to showing the shortcodes for Country & State. Isn't it possible to ...
3
votes
0answers
589 views

Lead.Country value is null in beforeInsert with state country picklist turned on

I have code called from the before update/before insert triggers that looks at the Country value, and if found or is changed, we call some custom code to find a matching record in a custom Territory ...
2
votes
1answer
102 views

StateCode, CountryCode fields not available in SalesforceDX

I am trying to switch to DX but noticed that the CountryCode and StateCode are no longer being recognized by Salesforce in DX environment. Trying to reference those fields gives me an invalid field ...
2
votes
1answer
617 views

Enabling State and Country/Territory Picklists

Currently we are using text field to store state and country. Now we want to enable State and Country/Territory Picklists to maintain data quality in salesforce. If I enable the picklist, what all ...
2
votes
2answers
307 views

Tough spot: updated State/Country fields to picklists but now code coverage is too low!

I recently went through the process of updating my state and country fields to picklists using the standard Salesforce tools. Perhaps foolishly I completed this update directly in production. However ...
2
votes
1answer
32 views

A user at higher role should have access to his subordinates records only. Is the solution to create multiple roles for the same level?

I have the following situation for role hierarchy: World | ------------- | | Europe Asia | |...
2
votes
1answer
106 views

State and Country/Territory picklist enabled

Why is apex Trigger unable to get value from Country/BillingCountry field in a BEFORE INSERT/UPDATE trigger when State and Country/Territory picklist enabled and data created from salesforce UI in ...
2
votes
1answer
2k views

How to convert a two letter country code into a country name?

Before implementing country and state picklists we want to change our APEX to insert country names instead of country codes. Now. I could just have a big map of country codes to country names but the ...
2
votes
1answer
2k views

Required field validation rule for [Billing|Shipping]StateCode with State & Country picklists enabled?

When using State & Country picklist functionality, is it possible to write a Validation Rule that targets the Billing State or Shipping State fields to make them required but only when the Country ...
2
votes
1answer
357 views

Country/State Picklist Enable Disable fuctionality

I want to write one query on Country/State picklist that if ( Country/State pick list == True) use this Query else this one Is there any way to find that Country/State Pick list status value? any ...
2
votes
1answer
158 views

Why does the DependentPicklists class returns empty Map when trying to output Country and State picklist?

We are implementing the DependentPicklists class found in another answer on this site. Our org has State and Country picklists enabled, so we are trying to get this to work using the Contact....
2
votes
0answers
177 views

Issue with Datacloud.FindDuplicates & County-State-Picklist & PURGE Data

We have a strange issue arising in the context of the Salesforce Standard Deduplication functionality. It happens only, when Country-State-Picklist are enabled and a record (Account) is set to a ...
1
vote
1answer
2k views

Get two letter country code in Apex method

I want to write an Apex method that takes a country name as input and returns the equivalent two letter country code (ISO A2). Is there a way to write it without explicitly hard coding all countries ...
1
vote
2answers
312 views

Use Ampscript to convert state abbreviation to full state name

So the state data in our database is abbreviation but we have a client who wants to display the state dynamically in the body of the email but they want to display the full state name. I'm fairly new ...
1
vote
1answer
4k views

State and Country Picklist Causing Issues with Import

I'm tried to import Accounts into an instance with Country Picklists enabled and running into issues. If the country of the record is not the country set as Default in SFDC State and Country Picklist ...
1
vote
1answer
96 views

SFDX - Can't Create Unlocked Package Version With BillingCountryCode/BillingStateCode

I am getting an error when trying to create a version of my unlocked package after adding Apex code that references the Account.BillingCountryCode and Account.BillingStateCode fields. Everything is ...
1
vote
1answer
36 views

Can we query State and Country/Territories Picklist via SOQL? [closed]

We need to check the validations manually in Batch Apex while creating SF Accounts? We have a scenario where we store all the data in our Custom Object (brought the data from the third party). In a ...
1
vote
1answer
1k views

How to get the BillingstateCode from BillingState?

I have a requirement like, If user enter BillingState manually in visualforce page then BillingStateCode must have to set automatically based on the BillingState. I am thinking to use MAP in this ...
1
vote
2answers
208 views

State Picklists ignoring StyleClass Directive

I'm trying to style my state picklist and it looks like the functionality that allows statecode/countrycode to be dependent on eachother is clobbering the styleClass that I specify. When I inspect the ...
1
vote
1answer
265 views

How can we convert a captured IP address to a country location when importing lead info from an external form, like on Unbounce?

We are capturing leads from our Unbounce landing pages, that have a Salesforce integration. Unfortunately they only provide the IP and we want to record the lead's country. How can we convert IP to ...
1
vote
0answers
17 views

Additional geographical area on State

I'd like to add additional information on the State in Salesforce, for example the macro-area it belongs to, so that it can be used in any report, view, feature that make usage of an Address / State. ...
1
vote
2answers
2k views

Error: There's a problem with this state, even though it may appear correct. Please select a state from the list of valid states

I am updating records through batch class. I have state/Country picklist enabled for my ORG, however for few set of records BillingState picklist is having following values i. UNKNOWN VALUE ...
1
vote
0answers
1k views

Find whether the state code is related to the Country code

When state/country picklists are enabled, in an apex class can i find whether the state code is related to the country code. Currently if no check is done. I'm getting the below error in the visual ...
1
vote
0answers
109 views

Mass Update And Mass Edit From List View clashes with State/Country Picklists

The following appears when I click on “Mass Update” in a list of recently created leads: core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and ...
1
vote
0answers
68 views

State and Country picklist scan result issue

I have used the option "Scan your org" in State and Country Picklists to get the address list and customization list (VF and APEX used) in that list one VF page is showing up which is not using city, ...
1
vote
0answers
299 views

Why is Serbia not among selectable countries in Salesforce.com?

So I decided to join Salesforce Partner Community, however, I can't complete my application as I'm from Serbia and there's no Serbia as an option among the list of available countries. Does anybody ...
0
votes
1answer
92 views

Can I add additional fields to “State and Country Picklists”

My org uses "State and Country Picklists" and I've been asked if it's possible add additional fields to the object so we can align each country to a region, sub-region and cluster and the ISO 3 digit ...
0
votes
1answer
1k views

How to apply State and Country Picklist on a Custom Object after enabling the feature

I followed the instructions for enabling the State and Country Picklist from https://resources.docs.salesforce.com/222/latest/en-us/sfdc/pdf/state_country_picklists_impl_guide.pdf And afterwards when ...
0
votes
1answer
946 views

Get English Country Name from Country-Picklist

we plan to enable the new Salesforce Country/State-Picklists. we love the idea to have ISO Country-Codes but for a different system we need all the country-names in US-english spelling/name. our org-...
0
votes
2answers
42 views

The ShippingStateCode field contains 21, which is not an available state

I changed some integration values from the country / state pick list: When I try to insert a record by integration, I get the error: "The ShippingStateCode field contains 21, which is not an ...
0
votes
1answer
231 views

Display State Picklist Values in Custom LWC Record-Edit-Form

I have a custom LWC that displays contact information to edit. One of the fields is the MailingState. Currently this field is a standard input field but I would like it to display as a picklist. Its ...
0
votes
1answer
34 views

How to Enable all state list for State and country picklist

We were using the state and country text field in address. Now, we have enabled the standard state and country picklist. But the state picklist is shown for only 9 countries. Eg. USA has state ...
0
votes
1answer
731 views

Country Code(telephone) values in Salesforce

I have a scenario wherein we want to provide users with list of CountryName Country Code to select when providing contact details , here is how the list looks like : Has anybody had a requirement and ...
0
votes
1answer
970 views

How do I retrieve Country and State Picklist Values (AddressSettings) via API?

How do I get a dependent list of States by Country from Salesforce via API? Our Use Case is: We need dependent Picklists on an integrated 3rd party web platform we intend to pass the returned ...
0
votes
1answer
3k views

How do I get Country State Picklist Values in a lightning component? [duplicate]

We have State and Country Picklist enabled in the org. I cannot find a way to find out the list of states based on the selected country. I need this in the lightning component. I've used ...