vault mdl
Execute an MDL statement.
vault mdl <STATEMENT>Options
Section link for Options| Option | Type | Required | Description |
|---|---|---|---|
<STATEMENT> | string | Required | The MDL statement or script to execute, enclosed in quotes |
This command also accepts the global options.
Examples
Section link for ExamplesExecute from a file (macOS / Linux)
Section link for Execute from a file (macOS / Linux)vault mdl "$(cat components/Picklist/color.mdl)"Execute from a file (Windows PowerShell)
Section link for Execute from a file (Windows PowerShell)vault mdl (Get-Content -Raw components/Picklist/color.mdl)Note: vault mdl does not read from stdin. Passing the file content as a string argument works on all platforms.
Component files in a vault config pull workspace contain @ references to subcomponent and sidecar files, so vault mdl cannot execute them directly. Use vault config push to deploy workspace components.
Create a picklist
Section link for Create a picklistvault mdl "CREATE Picklist color__c (label('Color') active(true));"Recreate a picklist with new values
Section link for Recreate a picklist with new valuesvault mdl "RECREATE Picklist color__c (label('Color') active(true) ENTRY red__c (label('Red') active(true)) ENTRY blue__c (label('Blue') active(true)));"Drop a component
Section link for Drop a componentvault mdl "DROP Picklist old_status__c;"Output
Section link for OutputSingle statement, no warnings:
Executing MDL...
SUCCESS MDL executed.Multi-statement script:
Executing MDL...
[1] SUCCESS CREATE Picklist.color__c
[2] SUCCESS DROP Picklist.old__c
SUCCESS MDL executed.Statements with warnings produce MDL executed with warnings. instead of SUCCESS MDL executed.
If a statement fails, the CLI reports every statement's outcome, not only the failing one. MDL scripts are not transactional. Earlier successful statements are not rolled back on failure.
For MDL syntax, see the MDL reference.