Sunday, 4 July 2021

Custom Metadata Types CLI Commands with Summer 20 Release

Hi,

With Summer 20 release we have very important CLI Commands for Custom Metadata Types

These new commands simplify development and help you build automation and synchronize your source from scratch orgs when working with custom metadata types.

The Salesforce CLI custom metadata types commands are available in v49.0.The Salesforce CLI custom metadata types commands are available in v49.0.

  • sfdx force:cmdt:create Creates a new custom metadata type in the current project.
  • sfdx force:cmdt:field:create Generates a custom metadata field based on the field type provided.
  • sfdx force:cmdt:generate Generates a custom metadata type and all its records for the provided sObject.
  • sfdx force:cmdt:record:create Creates a new record for a given custom metadata type in the current project.
  • sfdx force:cmdt:record:insert Creates new custom metadata type records from a CSV file.



EXAMPLE Insert records into an existing custom metadata type from a CSV file.

Create a CSV file and provide the API name of the custom metadata type in the insert command. For example,

NameCountryCode__cCountryName__c
AustraliaAUAustralia
BrazilBZBrazil
CanadaCACanada
sfdx force:cmdt:record:insert 
-f ~/Downloads/CMT_CSV\ -\ sfdx\ force_cmdt_record_insert\ Country\ Data\ -\ CMT_country.csv -t CmdtCountry

 


Reference:

https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_forcecom_dev_cmt_cli.htm?edition=&impact=

https://help.salesforce.com/articleView?id=sf.custommetadatatypes_cli.htm&type=5


No comments:

Post a Comment

What’s the difference between Einstein Article Recommendations and Suggested Articles?

How Does Einstein Article Recommendations Work? Einstein Article Recommendations helps support agents resolve customer cases efficiently by ...