Execute MDL Script
This endpoint executes the given MDL script on a Vault.
POST
/api/mdl/executeHeaders
Section link for Headers| Name | Description |
|---|---|
Content-Type | application/json or application/xml |
Accept | application/json (default) or application/xml |
Body Parameters
Section link for Body ParametersThe body of the request should contain the MDL script to execute. Enter the body as raw data. The body must start with one of the following values:
CREATERECREATERENAMEALTERDROP
Learn more in the MDL Commands documentation.
Example Body: RECREATE Picklist
Section link for Example Body: RECREATE PicklistIn this example, we update our picklists using the RECREATE command. If a picklist exists with the name color__c, Vault updates it to conform to the definition provided. If not, Vault creates a new picklist with the definition provided.
Request
Section link for Requestcurl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/json" \
--data-binary @"mdl.txt" \
https://myvault.veevavault.com/api/mdl/executeExample Body: RECREATE Picklist
Section link for Example Body: RECREATE PicklistRECREATE Picklist color__c (
label('Color'),
active(true),
Picklistentry red__c(
value('Red'),
order(1),
active(true)
),
Picklistentry blue__c(
value('Blue'),
order(2),
active(true)
),
Picklistentry green__c(
value('Green'),
order(3),
active(true)
)
);Example Body: RECREATE Java SDK Trigger
Section link for Example Body: RECREATE Java SDK TriggerRECREATE Recordtrigger my_custom_trigger_name__c (
active (true),
source_code (<VeevaData>
...
</VeevaData>)
);Response : RECREATE Picklist
Section link for Response : RECREATE Picklist{
"responseStatus": "SUCCESS",
"script_execution": {
"code": "GEN-S-0",
"message": "OK",
"warnings": 0,
"failures": 0,
"exceptions": 0,
"components_affected": 1,
"execution_time": 0.028
},
"statement_execution": [
{
"vault": "promo-vee.vaultdev.com",
"statement": 1,
"command": "RECREATE",
"component": "Picklist.color__c",
"message": "[SUCCESS] RECREATE Picklist color__c",
"response": "SUCCESS"
}
]
}Response Details
Section link for Response DetailsOn SUCCESS, the response contains details of the execute.