0

Im trying to generate a release artifact by converting some source files to metadata format so I can deploy it with the following command:

sfdx force:mdapi:deploy...

this is the command I'm using for the conversion step:

sfdx project:source:convert --output-dir="my_release_artifact" --manifest=".\releasePackage\package.xml"

As you can tell I'm telling the command that is should convert the files specified in the "package.xml"

This is the content of the package.xml:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Required_Fields.Record1</members>
        <members>Required_Fields.Record2</members>
        <members>Required_Fields.Record3</members>
        <members>Required_Fields.Record4</members>
        <members>Required_Fields.Record5</members>
        <name>CustomMetadata</name>
    </types>
    <types>
        <members>Required_Fields__mdt</members>
        <name>CustomObject</name>
    </types>
    <version>55.0</version>
</Package>

When I execute that command I get the following error:

Error (1): C:\Users\xxxxx\Documents\xxxxxxx\xxxxxxxx\my_release_artifact\customMetadata\Required_Fields.Record1.m: Could not infer a metadata type

That's all it does... I tried modifying the package by adding the "__mdt" sufix:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Required_Fields__mdt.Record1</members>
        <members>Required_Fields__mdt.Record2</members>
        <members>Required_Fields__mdt.Record3</members>
        <members>Required_Fields__mdt.Record4</members>
        <members>Required_Fields__mdt.Record5</members>
        <name>CustomMetadata</name>
    </types>
    <types>
        <members>Required_Fields__mdt</members>
        <name>CustomObject</name>
    </types>
    <version>55.0</version>
</Package>

With this modification it does not throw the error anymore but it does not generate the metadata for those records...

Thank you for your time.

1 Answer 1

0

Ok, I was able to successfully complete the conversion step.

The problem could have been related related to the project's folder structure... I'm working on a fairly old project that was originally created with the "ForceCode" extension, that extension used to create projects with a different folder structure than the one you get when you create a project with SalesForceDX.

How I got it to work:

  1. I created a new project (with manifest) with SFDX
  2. Authorized an org (my sandbox)
  3. Updated the package.xml to include the elements I needed to convert
  4. Right click on the package.xml > retrieve this source from org
  5. executed the command: sfdx project:source:convert...

Success.

You must log in to answer this question.

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