Skip to main content
4 votes
Accepted

Is there a CLI command to find all Test classes associated with a certain Apex class?

No, there is not. About the closest thing we have to that is to run all tests in an org and then query data from the ApexCodeCoverage object in the Tooling API (and also the ApexClass object, so you ...
Derek F's user avatar
  • 62.5k
3 votes
Accepted

Is it possible to stop/clear/refresh the source tracking for a single file?

You do this using the .forceignore file. This is similar to .gitignore in that it lists files and file path patterns (using wildcards) that should not be synced between your file system and the org ...
Phil W's user avatar
  • 36.9k
2 votes
Accepted

sf project deploy preview shows conflicts, but files are identical

Source tracking works by grabbing the last modified time stamp from the file when you do a pull or push, and also tracks the timestamps of the local files. If the last known time stamp on the server ...
sfdcfox's user avatar
  • 495k
2 votes
Accepted

Is it possible to deploy by filename using the new CLI?

If you look further down in the documentation on sf project deploy start, it'll go over the individual flags in more detail. Directly quoting that documentation: -d | --source-dir SOURCE-DIR Optional ...
Derek F's user avatar
  • 62.5k
1 vote
Accepted

What is the way to set LWC (Lightning debug mode) with an 'sf cli' command for the admin User if it exists?

You could automate this with something like: sf data update record --sobject User --where "Name='User User'" --values "UserPreferencesUserDebugModePref=true" Change the query ...
sfdcfox's user avatar
  • 495k
1 vote
Accepted

Migration from ANT to Salesforce CLI v2 - Script

First, note that logging in is usually a one-step process, rather than something you do each time you run the command. That said, check out sf org command for various login options. In the general ...
sfdcfox's user avatar
  • 495k
1 vote

Is it possible to deploy by filename using the new CLI?

Yes, the project deploy start command is the approximately equivalent command as force:source:deploy. See the force:source:deploy documentation for the list of differences between the two commands. -p,...
sfdcfox's user avatar
  • 495k
1 vote

Is there a CLI command to find all Test classes associated with a certain Apex class?

In theory, you can query MetadataComponentDependency, as each unit test will depend on the class that it calls, but you may end up with some false positives or negatives, because this object can only ...
sfdcfox's user avatar
  • 495k
1 vote
Accepted

How to retrieve last modification time of files stored in Org?

The metadata retrieve API doesn't include timestamps of the metadata. Use sf org metadata list or sf data query --use-tooling-api if you want this kind of metadata.
sfdcfox's user avatar
  • 495k
1 vote
Accepted

Data command missing in sf CLI

Version 1.44 is old, the current version a time of writing is 2.21 (a difference of a few hundred releases!) So the fix here is simply one of the common IT troubleshooting steps, making sure you're on ...
Derek F's user avatar
  • 62.5k
1 vote

Method is available in sandbox but not in prod

Try the Compile All Classes feature mentioned in Manage Apex Classes. You'll find this in Setup > Custom Code > Apex Classes. The most likely scenario is that there is another class that needs ...
sfdcfox's user avatar
  • 495k
1 vote
Accepted

"connectedStatus" in `sf org list` command contains HTML page markup

This is a known issue. You can find the answer here. Try install @salesforce/[email protected] or newer.
TEvGenius's user avatar
1 vote

How can I get the Org Connection info from the org currently used in the command on which a CLI Hook is running?

If you are trying to do this via the @salesforce/core library the API has changed. It would now look something like this: // find alias from project settings const project = await SfProject....
NSjonas's user avatar
  • 10.2k

Only top scored, non community-wiki answers of a minimum length are eligible