5

I have created a Custom Metadata Type object (lets say I have called it CMDObject__mdt). I have uploaded all of my configuration records into there but there are 12k records and so I cannot deploy using a wildcard in an ANT package as there is a limit of 10k "items" per metadata call.

So I cam trying to split it into three ANT packages - one with the objects (along with the other items of the package), and then two packages that contain roughly 6k of the records each.

I have trailed through the Salesforce documentation for the custom metadata type here: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadata.htm#custom_metadata_usage

But I cannot find anything that allow me to single out specific records as the CustomMetadataValue type seems to be directed into a field by field value, rather than record by record.

Deploying these configs via the Custom Metadata Loader is a viable option (that's how I got them there in the first place) but I would rather have deployable packages so that I don't have to install it in production.

Can anyone assist in how I could deploy a specific set of records from within the custom metadata type object via ANT (ANT is preferred but at this point I am open to suggestions other than Custom Metadata Loader).

Thankyou!

2

The top-level element in any of these files should be <CustomMetadata>. The <CustomMetadataValue> elements inside it do specify the values to use for its specific fields.

You can single out specific records using the filename of the record you upload (and its entry in the package.xml file). The form for the file name is

CustomMdTypeNameNoSuffix.RecordName.md

So if your custom metadata type is called MyCmType__mdt, and your record developer name is "Howdy", you'd call the file

MyCmType.Howdy.md

The entry in package.xml is the same, except without the ".md".

This is assuming there are no namespaces (or only your org's namespace) involved; if, say, the type is installed from a package with namespace foo, you should use

foo__MyCmType.Howdy.md

If the record is also in an installed managed package (say, with namespace bar), you should use

foo__myCmType.bar__Howdy.md

Hope this helps!

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.