custommetadata

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EditCmd = &cobra.Command{
	Use:   "edit [filename]...",
	Short: "Edit custom metadata",
	Args:  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			if field != "" {
				editCustomMetadataValue(file, field, value)
			}
			if label != "" {
				editCustomMetadataLabel(file, label)
			}
		}
	},
}
View Source
var ListCmd = &cobra.Command{
	Use:   "list [flags] [filename]...",
	Short: "List custom metadata",
	Args:  cobra.MinimumNArgs(1),
	Example: `
$ force-md custommetadata list -f 'dlrs__CalculationMode__c != "Realtime"' src/customMetadata/dlrs__LookupRollupSummary2.*
`,
	Run: func(cmd *cobra.Command, args []string) {
		filter, _ := cmd.Flags().GetString("filter")
		listCustomMetadata(args, filter)
	},
}
View Source
var NewCmd = &cobra.Command{
	Use:                   "new [filename]...",
	Short:                 "Create new custom metadata record",
	DisableFlagsInUseLine: false,
	Example: `
$ force-md custommetadata new src/customMetadata/My_Metadata.Example.md -l 'My Example' -v '{My_Field__c: "My Value", Default__c: true}'
`,
	Args: cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		label, _ := cmd.Flags().GetString("label")
		values, _ := cmd.Flags().GetString("values")
		for _, file := range args {
			createFile(file, label, values)
		}
	},
}
View Source
var TableCmd = &cobra.Command{
	Use:   "table [flags] [filename]...",
	Short: "List custom metadata in a table",
	Args:  cobra.MinimumNArgs(1),
	Example: `
$ force-md custommetadata table -f 'dlrs__CalculationMode__c != "Realtime"' src/customMetadata/dlrs__LookupRollupSummary2.*
`,
	Run: func(cmd *cobra.Command, args []string) {
		filter, _ := cmd.Flags().GetString("filter")
		fields, _ := cmd.Flags().GetStringArray("fields")
		fieldMap := make(map[string]struct{})
		for _, f := range fields {
			fieldMap[strings.ToLower(f)] = struct{}{}
		}
		tableCustomMetadata(args, filter, fieldMap)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL