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 test-kklzgqn0jcca@example.com -s User -v "Alias='testA', Email='my@email.com', EmailEncodingKey='ISO-8859-1', LastName='Testing', ProfileId='**StdUserProfID**', UserName='scratchTestBySFDX@testSFDX.SFDX.test', TimeZoneSidKey='America/Los_Angeles', LanguageLocaleKey='en_US', LocaleSidKey='en_US'" ERROR: Time Zone: bad value for restricted picklist field: America/Los_Angeles,.

0

Don't use commas to separate values:

sfdx force:data:record:create -u test-kklzgqn0jcca@example.com -s User -v "Alias='testA' Email='my@email.com' EmailEncodingKey='ISO-8859-1'  LastName='Testing' ProfileId='**StdUserProfID**' UserName='scratchTestBySFDX@testSFDX.SFDX.test' 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.

  • 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 May 11 '18 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 May 11 '18 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 May 11 '18 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.