Question is simple what is the main reason to use project-scratch-def.json VS settings. They overlap a lot and I don't know when I should define features in scratch-def.json
, and when to push them in settings
?
A little bit of background. I am migrating an existing enterprise project to SFDX and they have a lot of features enabled:
Now I added settings to .forceignore
to avoid push errors. But I don't feel it's right to exclude settings. For example, Knowledge.settings-meta.xml
has a ton of settings which I am not sure possible to add in scratch-def.json
(and why would I? I want to keep Knowledge.settings-meta.xml
in my version control since this is metadata and, in the end it will be deployed to org, not scratch-def.json
):
<?xml version="1.0" encoding="UTF-8"?>
<KnowledgeSettings xmlns="http://soap.sforce.com/2006/04/metadata">
<answers>
<enableArticleCreation>false</enableArticleCreation>
</answers>
<cases>
<enableArticleCreation>false</enableArticleCreation>
<enableArticlePublicSharingSites>false</enableArticlePublicSharingSites>
<enableCaseDataCategoryMapping>false</enableCaseDataCategoryMapping>
<useProfileForPDFCreation>false</useProfileForPDFCreation>
</cases>
<defaultLanguage>en_US</defaultLanguage>
<enableChatterQuestionKBDeflection>false</enableChatterQuestionKBDeflection>
<enableCreateEditOnArticlesTab>true</enableCreateEditOnArticlesTab>
<enableExternalMediaContent>true</enableExternalMediaContent>
<enableKnowledge>true</enableKnowledge>
<enableLightningKnowledge>true</enableLightningKnowledge>
<showArticleSummariesCustomerPortal>true</showArticleSummariesCustomerPortal>
<showArticleSummariesInternalApp>true</showArticleSummariesInternalApp>
<showArticleSummariesPartnerPortal>true</showArticleSummariesPartnerPortal>
<showValidationStatusField>false</showValidationStatusField>
<suggestedArticles>
<caseFields>
<field>
<name>Primary_Issues__c</name>
</field>
<field>
<name>Platform_Services__c</name>
</field>
<field>
<name>Sub_Category__c</name>
</field>
</caseFields>
<useSuggestedArticlesForCase>true</useSuggestedArticlesForCase>
<workOrderFields>
<field>
<name>Subject</name>
</field>
</workOrderFields>
<workOrderLineItemFields>
<field>
<name>Subject</name>
</field>
</workOrderLineItemFields>
</suggestedArticles>
</KnowledgeSettings>
But my question is Do I still need to replicate all of these in the scratch-def.json
file? Or just some of them? What is the best way to handle this?