2

I created a scratch org, made some custom objects and adjusted custom tab settings. I pulled it and pushed it to a newly created scratch org. However, my custom tab settings is not applied and I have to manually go to Setup -> Users -> Profile and adjust the custom tab settings manually.

I have seen a solution from this post, but I don't have .profile-meta.xml. Adding 'standard-' on my standard__LightningSales.app-meta.xml, and I got a push error:

In field: tab - no CustomTab named standard-CustomObjectName__c found

This is the content of CustomObjectField__c.field-meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>CustomObjectField__c</fullName>
    <defaultValue>false</defaultValue>
    <externalId>false</externalId>
    <label>CustomObjectName</label>
    <trackTrending>false</trackTrending>
    <type>Checkbox</type>
</CustomField>

How do I get custom object/tab settings so I don't have to set it manually every time I created new scratch org? My goal is to create a batch script to create a scratch org with all the custom objects and the records.

2

If you're working with scratch orgs, best practice would be to create a Permission Set that grants access to the custom tab / custom object, and auto-assign it after the scratch org has been created with:

sfdx force:user:permset:assign -n MyPermissionSet

As far as pulling Profile permissions into your local machine, try:

sfdx force:source:retrieve -m Profile:Admin,Profile:My_Custom_Profile,CustomObject:My_Custom_Object__c -u MyConnectedOrg
1
  • 1
    Permission set is what I am looking for. Thank you!
    – user2018
    Jul 23 '19 at 12:30

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.