English
triggerSaveDraft()
About 101 wordsLess than 1 minute
2025-11-24
Triggers save draft. Used together with the isSupportDraft method.
Parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
| background | Whether to run in the background without showing loading | Boolean | false |
| close | Whether to close the page after saving succeeds | Boolean | true |
Return Value
None
Code Example
{
event: "form.render.end",
functional: function (pluginExecResult, options) {
console.log("custom plugin: form.render.end exec");
let {bizApi}=options;
// Example only. Usually suitable for triggering in a custom button
// bizApi.isSupportDraft() determines whether save draft is supported
if(bizApi.isSupportDraft()){
bizApi.triggerSaveDraft({background:false, close:false})
.then(()=>{
console.log("save draft success")
})
.catch(e=>{
console.log("save draft error", e)
});
}
}
},