3

I am new to salesforce, so my question may seem basic.

Whenever we create a field, we set the visibility/read-only for various profiles.

How do i get that info in metadata? I created a field on Case object, then used workbench to retrieve the Case object. Following is all the info i see in Case.object (i have removed other info for convenience, just kept info for the new field here)

<fields>
        <fullName>Escalated_To__c</fullName>
        <deleteConstraint>SetNull</deleteConstraint>
        <externalId>false</externalId>
        <label>Escalated To</label>
        <referenceTo>User</referenceTo>
        <relationshipName>CasesQCk0</relationshipName>
        <required>false</required>
        <trackFeedHistory>false</trackFeedHistory>
        <trackHistory>false</trackHistory>
        <trackTrending>false</trackTrending>
        <type>Lookup</type>
    </fields>

I didn't see anything else about this field in Case.object metadata file. How do i get the info i put in about profile visibility while creating the field?

2

This information is stored in the profile metadata. It will show up in the profile like:

<objectPermissions>
        <allowCreate>true</allowCreate>
        <allowDelete>true</allowDelete>
        <allowEdit>true</allowEdit>
        <allowRead>true</allowRead>
        <modifyAllRecords>true</modifyAllRecords>
        <object>MyCustomObject__c</object>
        <viewAllRecords>true</viewAllRecords>
</objectPermissions>

This way, you grant this permission to every user with the profile to Create, Delete, Edit and Read, etc.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.