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
StephenDicksonStephenDickson 

How to use VSCode to delete classes and triggers from production?

Now that Force.com IDE is out, can anyone help me figure out how to delete classes and triggers from production using VSCode SFDX?  

I tried the SFDX command, "Delete this from Project and Org," but the error stated testLevel of NoTestRun cannot be used and I can't see where to change the test level.

Thanks in advance!
Best Answer chosen by StephenDickson
VinayVinay (Salesforce Developers) 
Hi Stephen,

Yes,  that's the other way to delete components using workbench.

Below links provides you more information on 'Salesforce CLI'.

https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
https://trailhead.salesforce.com/en/content/learn/modules/sfdx_app_dev/sfdx_app_dev_setup_dx

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Stephen,

Please try 'sfdx force:source:deploy' command.

Check below.

"sfdx force:source:deploy -p "./PathToMetadata" -l RunSpecifiedTests -r TestClass1,TestClass2 -w 33 --verbose --loglevel fatal"

Review below link for more information on 'Help for force:source:delete'.

https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
StephenDicksonStephenDickson
Thanks for the reply, Vinay.  Without being well versed in CLI, I ended up having success with a destructiveChanges.xml file as in this post (https://salesforce.stackexchange.com/questions/46612/how-to-delete-a-test-class-without-using-eclipse).
VinayVinay (Salesforce Developers) 
Hi Stephen,

Yes,  that's the other way to delete components using workbench.

Below links provides you more information on 'Salesforce CLI'.

https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
https://trailhead.salesforce.com/en/content/learn/modules/sfdx_app_dev/sfdx_app_dev_setup_dx

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer