count() fails with no field argument given (e.g. count(Id)) #1320
Labels
bug
Issue or pull request that identifies or fixes a bug
investigating
We're actively investigating this issue
Summary
When using the builtin count() function in a SOQL query via sfdx, an error message similar to the below will be thrown unless a specific field is used as an argument to the function, e.g. count(Id) (see Steps To Reproduce for a complete, specific example)
Steps To Reproduce:
Repository to reproduce: dreamhouse-lwc
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
sfdx force:auth:web:login
sfdx force:config:set defaultusername
(if necessary)sfdx force:data:soql:query -q "SELECT count() FROM PermissionSetAssignment WHERE PermissionSetId='0PS6T0000024uYe'"
Expected result
A count of all records should be returned, as per other tools which make similar SOQL API calls, and not an error.
Additonally, the error messaging "The query result is missing n records due to a y record limit" and "... n or greater than y" is pretty silly for values of y>=n ...
Actual result
Error message(s). See Summary, above.
System Information
If you are using
sfdx
sfdx version --verbose --json
jungar@jungar-ltm1 aloha_sfdx % sfdx version --verbose --json | jq { "cliVersion": "sfdx-cli/7.130.1", "architecture": "darwin-x64", "nodeVersion": "node-v16.13.1", "pluginVersions": [ "@oclif/plugin-autocomplete 0.3.0 (core)", "@oclif/plugin-commands 1.3.0 (core)", "@oclif/plugin-help 3.2.10 (core)", "@oclif/plugin-not-found 1.2.4 (core)", "@oclif/plugin-plugins 1.10.6 (core)", "@oclif/plugin-update 1.5.0 (core)", "@oclif/plugin-warn-if-update-available 1.7.3 (core)", "@oclif/plugin-which 1.0.3 (core)", "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)", "alias 1.2.0 (core)", "apex 0.4.0 (core)", "auth 1.8.0 (core)", "config 1.3.0 (core)", "custom-metadata 1.0.12 (core)", "data 0.6.6 (core)", "generator 1.2.1 (core)", "info 1.1.2 (core)", "limits 1.3.0 (core)", "org 1.11.0 (core)", "salesforce-alm 53.6.0 (core)", "schema 1.1.0 (core)", "sfdx-cli 7.130.1 (core)", "source 1.6.2 (core)", "telemetry 1.4.0 (core)", "templates 52.6.0 (core)", "trust 1.1.0 (core)", "user 1.7.0 (core)" ], "osVersion": "Darwin 19.6.0" }
Additional information
The text was updated successfully, but these errors were encountered: