You need to sign in to do that
Don't have an account?
Sébastien Beaulieu
Do someone know how to add States in Metadata States PickList from code
When I try to add a new Account by using RestAPI and the BillingStateCode does not exists in the metadata State PickList we receive a error.
Is it possible to Add with Apex Code missing State in the metadata State PickList ?
Thanks
You can use the Metadata API to edit existing states and countries in state and country picklists. You can’t use the Metadata API to create or delete new states or countries.
Review below idea link for same.
https://trailblazer.salesforce.com/ideaView?id=08730000000l6DGAAY
Few references that can help you
https://salesforce.stackexchange.com/questions/20755/how-to-mass-populate-state-country-picklist-values
https://salesforce.stackexchange.com/questions/269708/can-anyone-tell-me-how-to-get-state-country-picklist-values-metadata-api?rq=1
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar