Skip to content

Instantly share code, notes, and snippets.

@jstvz
Created October 19, 2017 20:40
Show Gist options
  • Save jstvz/e25e9360e22294a6e6e8726eca824560 to your computer and use it in GitHub Desktop.
Save jstvz/e25e9360e22294a6e6e8726eca824560 to your computer and use it in GitHub Desktop.
SFDX Event bug

Event SFDX bug

Steps to Reproduce

  1. Create a new sfdx project:
sfdx force:project:create -n test
create test/sfdx-project.json                                                 
create test/README.md                                                         
create test/config/project-scratch-def.json                                   
  1. Switch to the project and create a scratch org:
cd test
sfdx force:org:create -f config/project-scratch-def.json -s -a test
Successfully created scratch org: 00D0k0000004XO1EAM  username: test-afhylpsytwek@je_company.net 
  1. Attempt to create a new event:
echo "Event evt = new Event(Subject = 'NO!', DurationInMinutes=1, ActivityDateTime=Datetime.now().addDays(1)); insert evt;" | \
    sfdx force:apex:execute
Compiled successfully.
ERROR:  Execution failed.

 ▸    ERROR: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference
 ▸    id: []
 ▸    ERROR: AnonymousBlock: line 1, column 1

Existing tickets/notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment