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
Fraser RackhamFraser Rackham 

SFDX CLI - any way to return a list of fields (only) for a given object (fields only, not *all properties*)?

So, I can use the sfdx CLI command to get all the properties of an object using force:schema:sobject:describe -s OBJECT . However, this needs a fair bit of additional legwork to just get a list of fields. Is there a better command to use than the schema one?

From the excerpt below, I'd like to just get something like ['relationID', 'whoID']
{ actionOverrides: [],
  activateable: false,
  childRelationships: 
   [ { cascadeDelete: false,
       childSObject: 'AcceptedEventRelation',
       deprecatedAndHidden: false,
       field: 'RelationId',
       junctionIdListNames: [],
       junctionReferenceTo: [],
       relationshipName: 'AcceptedEventRelations',
       restrictedDelete: false },
     { cascadeDelete: true,
       childSObject: 'ActivityHistory',
       deprecatedAndHidden: false,
       field: 'WhoId',
       junctionIdListNames: [],
       junctionReferenceTo: [],
       relationshipName: 'ActivityHistories',
       restrictedDelete: false },
 
  • I have SFDX CLI working.
  • I can query SFDX from powershell if that is easier (and will if can't figure out an alternative).
Also, no DX category?