0

I am trying to complete App Builder Maintenance trailhead for Summer 19. However, I don't want to make change manually in the target organization since this is not interesting.

Instead, I am performing changes in Scratch Org, then I pull the changes from Scratch Org to understand where the changes are stored and then I am trying to deploy the metadata changes to the target Developer Edition organization.

When I am doing that, I receive the following error:

Record Type Context: bad value for restricted picklist field: m

When I remove the value for record type context, I see

Animation Frequency: bad value for restricted picklist field: a

When I remove both the values, I see error

Field recordTypeContext is required.

All the errors relate to force-app/main/default/animationRules/Milestones.animationRule-meta.xml source file which I pulled from Scratch Org where I did changes manually.

The source file has the following content

<?xml version="1.0" encoding="UTF-8"?>
<AnimationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <animationFrequency>a</animationFrequency>
    <developerName>Milestones</developerName>
    <isActive>true</isActive>
    <masterLabel>Milestones</masterLabel>
    <recordTypeContext>m</recordTypeContext>
    <recordTypeName>__MASTER__</recordTypeName>
    <sobjectType>Opportunity</sobjectType>
    <targetField>StageName</targetField>
    <targetFieldChangeToValues>Closed Won</targetFieldChangeToValues>
</AnimationRule>
0

Looks like there is some bug in pulling source for the Animation Rule.

Metadata API documentation says that

  1. valid values for required recordTypeContext picklist enum are All, Master, or Custom
  2. valid values for required animationFrequency picklist enum are always often sometimes rarely

Replacing m with Master and a with always helps to get rid of deploy command failure

<?xml version="1.0" encoding="UTF-8"?>
<AnimationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <animationFrequency>always</animationFrequency>
    <developerName>Milestones</developerName>
    <isActive>true</isActive>
    <masterLabel>Milestones</masterLabel>
    <recordTypeContext>Master</recordTypeContext>
    <recordTypeName>__MASTER__</recordTypeName>
    <sobjectType>Opportunity</sobjectType>
    <targetField>StageName</targetField>
    <targetFieldChangeToValues>Closed Won</targetFieldChangeToValues>
</AnimationRule>
|improve this answer|||||

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.