[SalesForce] Inactive Validation Rule set as Active in Deploy

I created a validation rule in a development environment then deployed it in a change set. After Business Requirements changed I needed to deactivate the validation rule.

Then I created a new change set with the inactive validation rule. When the new change set was deployed it was deployed with an "active" status.

Why did the Validation rule not deploy with an inactive status?

Best Answer

If you rename a Validation rule in between deployments, a Changeset will transfer it over as a new Validation rule (!)

Here's the metadata for a Validation Rule

<validationRules>
    <fullName>EventEndNotBeforeEventStart</fullName>
    <active>true</active>
    <errorConditionFormula>Event_Date_Start__c &gt; Event_Date_End__c</errorConditionFormula>
    <errorDisplayField>Event_Date_End__c</errorDisplayField>
    <errorMessage>Event End Date must be equal to or after Event Start Date</errorMessage>
</validationRules>

If I deployed the above and then renamed the VR in the UI to

<fullName>EventEndNotBeforeEventStartVersion2</fullName>

and then deployed again, I get a new rule. There's no label versus API name for a VR.