Questions tagged [country-and-state]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
75 views

recalculateFormulas() returns "System.HandledException: Script-thrown exception (System Code)" when Address has State selected

In trigger action BeforeInsert Quote, recalculateFormulas() returns this error "System.HandledException: Script-thrown exception (System Code)". It happens only when State is selected in ...
Jacinth's user avatar
0 votes
0 answers
104 views

State and Country/Territory Picklists - test and push to prod

Is there a way I can push my mapping changelist for state & country data? Current state data is so messy that it took me days in our sandbox environment, so I was hoping there's an easier way in ...
Julian A's user avatar
0 votes
1 answer
886 views

Bulk Importing State and Country Global Picklist Value

Is there a way to mass upload a list of Country’s and States into the Country and State Territory Picklist section of setup in Salesforce? Looks like its been an idea for a while and looking at the ...
andrew's user avatar
  • 149
-1 votes
1 answer
260 views

What fields are converted by State and Country/Territory Picklist?

I am looking to implement this. what fields will be changed by this? Only the default ones? Or does this apply to custom fields from custom objects as well? For example, we have a field called ...
Joao Moreira's user avatar
0 votes
0 answers
706 views

Address State and Country not visible on the records

Dear friends I have an interesting problem. The address fields are not correct visible on the records. On the account page I see all address fields, but on the Address record and Service Territory I ...
Константин Манков's user avatar
1 vote
1 answer
2k views

Error Country after enabling state and country picklist

Since I have enabled state and country picklist I get the following error: Update failed. First exception on row 0 with id 0013O00000rrYAFQA2; first error: FIELD_INTEGRITY_EXCEPTION, There's a ...
Thomas's user avatar
  • 2,294
0 votes
0 answers
710 views

Variable does not exist: MailingCountryCode

When I try to deploy to a scratch org a class that references the field MailingCountryCode on the object Contact, I receive the following error message : Variable does not exist: MailingCountryCode (...
THEDJA's user avatar
  • 125
0 votes
2 answers
2k views

How to Get List Of Countries in Apex

I'm aware that Salesforce provides a native way to use country and state values in Account and Contact address fields. But what if I want to use apex to get those list of countries so that I can use ...
jbyrd's user avatar
  • 631
2 votes
1 answer
412 views

SOQL Address Country not localized / translated

I'm querying an Account Address and want the country to be translated into the language of the requesting user. Sample query: SELECT BillingAddress FROM Account I maintained the translation of the ...
JohnMay's user avatar
  • 23
0 votes
1 answer
462 views

AddressSettings / State & Country picklists translation

Question on AddressSettings / State & Country picklists: Does anyone know if there is a way to retrieve translations of country picklist by language via Metadata API / any other exposed salesforce ...
Artem Kukharev's user avatar
2 votes
1 answer
529 views

Importing missing State in State and Countries Picklist via API

I am trying to import a missing state code in Italy, SU (see https://www.iso.org/obp/ui/#iso:code:3166:IT IT-SU) so I created the state code manually on a scratch org and I fetched the modified ...
Edmondo's user avatar
  • 1,702
0 votes
0 answers
28 views

How to insert a list of States in Salesforce with the Metadata API [duplicate]

Is it possible to insert a list of States in Salesforce with the Metadata API? How? Thank you very much. Additional Question (02-June-2021@12:11CEST): I have retrieved the XML file containing the ...
Eduardo's user avatar
2 votes
0 answers
1k views

Using Apex to query Country Picklist Integration Values

We are using global country picklist in our org. For historical reasons, some of our countries have a difference in the name of the country and the integration value of the country. From Apex, I ...
hamayoun's user avatar
  • 2,727
0 votes
1 answer
545 views

Account Billing Address Picklist without State and Country Picklists

I'm trying to replace the Standard BillingCountry field on the Account with a picklist, but it seems I can't remove the standard field and replace it with a custom picklist - does anyone have any idea ...
BiscuitBulldozer's user avatar
1 vote
2 answers
1k 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 ...
Tatiane Alves's user avatar
1 vote
1 answer
2k 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 ...
Navnaeeth's user avatar
1 vote
1 answer
4k 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 ...
Max's user avatar
  • 476
2 votes
1 answer
246 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 | |...
nSv23's user avatar
  • 544
0 votes
0 answers
118 views

Country/State Picklist Management through trigger

I am trying to map country and state from one custom object say 'User Submission' to Account's billing address. My custom object has more values of countries and states than standard Country/State ...
Ashutosh Srivastava's user avatar
0 votes
1 answer
829 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 ...
Robin Anderson's user avatar
2 votes
1 answer
671 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 ...
Priyankur Choudhury's user avatar
1 vote
1 answer
7k 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 ...
cpham's user avatar
  • 11
1 vote
1 answer
395 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 ...
Jeff Freeman's user avatar
0 votes
1 answer
268 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 ...
Ajinkyasd's user avatar
  • 325
2 votes
1 answer
2k 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 ...
Ajinkyasd's user avatar
  • 325
0 votes
0 answers
228 views

Unable to convert a lead if country if country is not defalut country

few dacks back we have enabled country & state picklist values. So, when trying to convert a lead with a country called Canada they are facing an issue. because currently, the default country is ...
Pavan tej's user avatar
  • 1,439
1 vote
2 answers
4k 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 ...
Harry_G's user avatar
  • 53
1 vote
1 answer
646 views

Add value to list of valid States

I added a new State for the Country 'Canada' in Setup -> State and Country/Territory Picklists. The State is 'BC' and StateCode is 'BC2'. See the image below for how it looks: Now that 'BC' is a ...
tom_12321's user avatar
  • 191
2 votes
1 answer
303 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....
Swisher Sweet's user avatar
8 votes
2 answers
549 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 ...
Uwe Heim's user avatar
  • 28.3k
1 vote
0 answers
362 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 ...
Uwe Heim's user avatar
  • 28.3k
0 votes
1 answer
3k 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 ...
TheArchitecta's user avatar
0 votes
1 answer
2k views

State/Country Picklist: The BillingStateCode field contains New Jersey, which isn't an available state

I am trying to migrate our production org to State/Country picklists. I followed the instructions of scanning my org in a Dev sandbox. There was no data to convert because it was a new blank sandbox, ...
Morgan Marchese's user avatar
0 votes
0 answers
554 views

Find state from Area Code

Our leads come in with just a phone number. I am looking to populate a custom field for the Lead State based off of that area code. I have already added a custom formula field to populate the time ...
Dennis's user avatar
  • 49
0 votes
1 answer
5k 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 ...
Tasnim's user avatar
  • 179
5 votes
1 answer
5k 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 ...
Keith C's user avatar
  • 135k
2 votes
1 answer
852 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 ...
Arthlete's user avatar
  • 4,855
3 votes
1 answer
1k 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-...
Adrian Larson's user avatar
  • 149k
1 vote
2 answers
815 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 ...
Ebony's user avatar
  • 11
3 votes
1 answer
165 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 ...
akarnid's user avatar
  • 1,964
4 votes
2 answers
2k 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....
Mystery's user avatar
  • 155
3 votes
1 answer
676 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 ...
Molly Stewart-Gallus's user avatar
1 vote
1 answer
3k 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 ...
Nail David's user avatar
2 votes
1 answer
4k 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 ...
Molly Stewart-Gallus's user avatar
3 votes
1 answer
5k 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 ...
SSK's user avatar
  • 361
-2 votes
2 answers
2k views

How to search a custom object using one or more input pick list fields from a VF page and display the result(s) in a pageBlockTable

accept the input as strings (in an extension), build & execute the query, populate a list element, display the list. Please give an example.
Ravindar Admin's user avatar
1 vote
0 answers
26 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. ...
Edmondo's user avatar
  • 1,702
0 votes
0 answers
463 views

State and Country Picklist on Visualforce page

I have a page which displays input fields from a fieldset on Opportunity object. The fieldset contains Country and State picklists which render properly. The only problem is when the Opportunity ...
ajinkyah's user avatar
  • 751
0 votes
1 answer
86 views

Issues after enabling state country pick list

We have implemented state/ country pick list after converting data. The issue is one class is shown in the customizations list which i need to update. i have below line in this class which is ...
night crawler's user avatar
1 vote
2 answers
7k 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 ...
Nachiket Deshpande's user avatar