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
Dr. Thomas MillerDr. Thomas Miller 

Salesforce CLI: sfdx source:force:retrieve

I have an org based project set up in VS Code and connected to a sandbox.
Package.xml contains
    <types>
        <members>*</members>
        <name>Profile</name>
    </types>
When I run sfdx source:force:retrieve the system creates profile-meta.xml data which contain applicationVisibilities, classAccesses, fieldPermissions (only for User custom fields), layoutAssignments, pageAccesses, tabVisibilities and userPermissions. Missing however are fieldLevelSecurities,loginHours, loginIpRanges, objectPermissions,recordTypeVisibilities.

Is there a way to retrieve these data as well? And which settings determine this selection?
Jonathan A FoxJonathan A Fox
I would download package XML generator add on it VS code, this shoudl help you achieve what you need to!
Dr. Thomas MillerDr. Thomas Miller
Actually the package.xml generator was the cause of the problem.
The API only downloads obect and field permissions for objects that you include into the package.xml. And the generator, if you select CustomObject, only puts
    <types>
        <members>User</members>
        <name>CustomObject</name>
    </types>
into the package.xml. If you want more object and field permissions you need
    <types>
        <members>*</members>
        <name>CustomObject</name>
    </types>
for all custom objects and nedd to list all standard obects you are interested in one by one, e.g.
    <types>
        <members>Account</members>
        <name>CustomObject</name>
    </types>

Note that you will never get field permissions for standard fields of standard objects - an unfortunate lack of functionality in the API.