function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Danny PhamDanny Pham 

sfdx: Create Trigger Error

Hello,
 I ran this command on VS code and got error. Please advice
>  sfdx force:apex:trigger:create --triggername AccountTrigger -s Account -e 'before insert, before update, before delete, after insert, after update, after delete, after undelete' --outputdir force-app\main\default\Triggers

 !    !   ' before delete' is not a valid trigger event.

Thanks
/Danny
Best Answer chosen by Danny Pham
Raj VakatiRaj Vakati
Space causing an issue .. use this command
 
sfdx force:apex:trigger:create --triggername AccountTrigger -s Account -e 'before insert,before update,before delete,after insert,after update,after delete,after undelete' --outputdir force-app\main\default\Triggers

User-added image

All Answers

Raj VakatiRaj Vakati
Space causing an issue .. use this command
 
sfdx force:apex:trigger:create --triggername AccountTrigger -s Account -e 'before insert,before update,before delete,after insert,after update,after delete,after undelete' --outputdir force-app\main\default\Triggers

User-added image
This was selected as the best answer
Danny PhamDanny Pham
Thank You. May I ask where is the space? Using notepad to compare and cannot tell the different
/Danny
Raj VakatiRaj Vakati
This trailing space is issue , before delete