1

I created a Process Builder in which I reference a Custom Metadata from a Formula inside of the "Update Record" action. It works fine on a Environment 1, but I have trouble with deploying it to another Env using Ant. I receive the following error:

All Component Failures:
1.  flows/Assign_Consulting_Request.flow -- Error: formula_12_myRule_11_A1_9453158556 (Formula) - The formula expression is invalid: Field ROW does not exist. Check spelling.

I'm a bit surprised because I don't have any ROW field. It's a record and the XML code for PB's formula is here:

<formulas>
    <processMetadataValues>
        <name>originalFormula</name>
        <value>
            <stringValue>$CustomMetadata.ConsultingServiceOwnerSettings__mdt.ROW.DefaultConsultingOpsOwnerId__c</stringValue>
        </value>
    </processMetadataValues>
    <name>formula_12_myRule_11_A1_9453158556</name>
    <dataType>String</dataType>
    <expression>{!$CustomMetadata.ConsultingServiceOwnerSettings__mdt.ROW.DefaultConsultingOpsOwnerId__c}</expression>
</formulas>

package.xml file provided below. As you can see I included the ROW record. I don't receive any errors on retrieve so I suppose everything should be fine here.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ConsultingServiceOwnerSettings__mdt.APAC</members>
        <members>ConsultingServiceOwnerSettings__mdt.NA</members>
        <members>ConsultingServiceOwnerSettings__mdt.ROW</members>
        <name>CustomMetadata</name>
    </types>
    <types>
        <members>ConsultingServiceOwnerSettings__mdt</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Assign_Consulting_Request</members>
        <name>Flow</name>
    </types>
    <version>46.0</version>
</Package>

In addition to that - the record is in retrieved package directory.

enter image description here

Any thoughts?

1

I believe the issue is in your package.xml. When you reference the Custom Metadata type in Custom object, you utilize __mdt

However, when you reference records of a Custom Metadata Type, you do not include __mdt.

This is mentioned in the Metadata API documentation for Custom Metadata

enter image description here

If you change your package.xml to this, it should appropriately bring the records over.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ConsultingServiceOwnerSettings.APAC</members>
        <members>ConsultingServiceOwnerSettings.NA</members>
        <members>ConsultingServiceOwnerSettings.ROW</members>
        <name>CustomMetadata</name>
    </types>
    <types>
        <members>ConsultingServiceOwnerSettings__mdt</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Assign_Consulting_Request</members>
        <name>Flow</name>
    </types>
    <version>46.0</version>
</Package>
| improve this answer | |
  • Thanks so much Kris, that was the issue! I just don't get it - if that's the proper way of using CustomMetadata component - why did Ant manage to retrieve the records at all? – Przemysław Tamoń Mar 30 at 12:53
  • That's a good question that I don't have an answer for! I'd check by opening the record file (.md) to see if it's got the same info as it does when you use the correct package.xml. – Kris Goncalves Mar 30 at 13:02
  • It's the same ¯_(ツ)_/¯ – Przemysław Tamoń Mar 30 at 13:07

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.