0

I'm Trying to create one user record with by creating them with SFDX and the minimum required data about the user, into a scratch org (later trying it in an actual sandbox or production), but I have this bad timezone problem... I Tried to use another time zone with the different label but same GTM offset, and tried with the label and value, of the picklist elements from the TimeZoneSidKey field...

Does anyone know how to solve this? should I insert them directly with use API? I want to avoid the Data loaders that already exists, they are my absolute last resort.

This is my Propmt Output. PS C:\Users\ME\workspace\salesforce\project> sfdx force:data:record:create -u [email protected] -s User -v "Alias='testA', Email='[email protected]', EmailEncodingKey='ISO-8859-1', LastName='Testing', ProfileId='**StdUserProfID**', UserName='[email protected]', TimeZoneSidKey='America/Los_Angeles', LanguageLocaleKey='en_US', LocaleSidKey='en_US'" ERROR: Time Zone: bad value for restricted picklist field: America/Los_Angeles,.

1 Answer 1

0

Don't use commas to separate values:

sfdx force:data:record:create -u [email protected] -s User -v "Alias='testA' Email='[email protected]' EmailEncodingKey='ISO-8859-1'  LastName='Testing' ProfileId='**StdUserProfID**' UserName='[email protected]' TimeZoneSidKey='America/Los_Angeles' LanguageLocaleKey='en_US' LocaleSidKey='en_US'"

Since you included the commas, the CLI thought you meant the literal value America/Los_Angeles,, which isn't a valid picklist value (note the comma at the end).

If this command hadn't failed, you'd probably have gotten other errors because of the commas.

3
  • Wow thanks, this was a little on clear on the documentation, so based the string on the user sObject constructor, idk It made sense for me.
    – ekiim
    Commented May 11, 2018 at 0:09
  • @ekiim I made that mistake once, too. It's actually in the documentation as an example, but it doesn't really call it out.
    – sfdcfox
    Commented May 11, 2018 at 0:14
  • I just went to the documentation, and saw it, after you replied, and It Popped right out after you mention it, it happens, well thanks
    – ekiim
    Commented May 11, 2018 at 0:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .