- 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
- 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
- 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