vault mdl
Execute an MDL statement directly against the connected Vault.
vault mdl <STATEMENT> [--dns <DNS>]Options
Section link for Options| Option | Type | Required | Description |
|---|---|---|---|
<STATEMENT> | string | Required | The MDL statement to execute, enclosed in quotes |
--dns <DNS> | string | Optional | Vault DNS to run against (default: the active vault) |
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.
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