1

I recently found out, with drastic consequences, that when deploying custom objects if we miss out some tags like then salesforce automatically assumes

<enableReports>false</enableReports>

in the target orgs(where we intended reporting to be enabled). Thus this missing tag made salesforce automatically assume that reporting needs to be turned off. Personally, I find this STUPID especially when they boast of the constructive changes only principle and stuff. May be I am not seeing the bigger picture due to my lack of knowledge, the forgive my previous comment.

So, fellow developers, are there other tags/properties in salesforce metadata api that behave likewise - makes salesforce automatically assume some unintended value. Just learned that 'enableReports' need to be explicitly specified in the object xml . Are there any other tags in object xml or any other metadata type that behaves similarly. Please do share your knowledge if you have come across a similar experience. Thanks in advance.

1 Answer 1

1

There are other tags like that which get turned off when they are not passed along with the basic object. So, suit that quirk, we are now passing all tags with the object irrespective other partials that we deploy. For example, if we migrate one field, our object file looks like this:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
<enableEnhancedLookup>true</enableEnhancedLookup>
<enableFeeds>true</enableFeeds>
<enableHistory>false</enableHistory>
<externalSharingModel>ReadWrite</externalSharingModel>
<fields>
    <fullName>Active__c</fullName>
    <externalId>false</externalId>
    <label>Active</label>
    <picklist>
        <picklistValues>
            <fullName>No</fullName>
            <default>false</default>
        </picklistValues>
        <picklistValues>
            <fullName>Yes</fullName>
            <default>false</default>
        </picklistValues>
        <sorted>false</sorted>
    </picklist>
    <trackFeedHistory>false</trackFeedHistory>
    <type>Picklist</type>
</fields>
<recordTypeTrackFeedHistory>false</recordTypeTrackFeedHistory>
<sharingModel>ReadWrite</sharingModel>

Let me know if you need more info and I can help.

Sridhar

1
  • So we eliminate unnecessary metadata rather than include needed. Safer this way. By the way, this turn-off philosophy extends to things like Description as well.
    – Sridhar
    Mar 12, 2016 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .