0

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?

5
  • 2
    did you rename the validation rule between deployments?
    – cropredy
    Jan 16, 2017 at 23:40
  • I did rename the validation rule. Does that mean I will have two different validation rules in the target organizations? Jan 17, 2017 at 1:08
  • 1
    Yes indeed! The VR name if changed, means a new VR when pushed thru changesets
    – cropredy
    Jan 17, 2017 at 1:26
  • Nice catch @cropredy Jan 17, 2017 at 2:43
  • Thank you for that catch! That saved me about a day of turn around time! After some digging I also found that y organization has a trigger that sets all VR to active upon deploy, as a safety measure that it plays well with other components. Thanks for answering my question @cropredy! Jan 17, 2017 at 14:04

2 Answers 2

0

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.

0
0

To answer the actual titled Question: That is not possible, and hence the route cause was not related to active or inactive. The accepted answer, answers a different question. The OP had renamed the VR and this was the reason for the situation occuring

But if you came here because you wanted to know if validation rules are set to active when deployed to prod:

If you were to deploy these components as active in source this would be the result in destination:

  • Validation Rules - Active (or the state they were in at source or within your package)
  • Workflow Rules - Active
  • Process Builder - Inactive
  • Flow - Inactive

Caveat - if you are using CICD process and you are setting the deployment flag of deploy flows & process in active state. This I am not 100% familiar with and is a constantly changing scenario, as Salesforce hone CICD.

  1. From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
  2. Select Deploy processes and flows as active

You must log in to answer this question.

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