Before Rendering Approval Content Edit Form/Page
flow.approval.edit.form.render.before
Description: This hook is triggered before rendering the approval content edit form/page in the approval details page, such as forcibly displaying the approval content edit form/page.
# 1. forceShowEditForm
# Functional Description
- For regular layout configurations of approval content: When there are no required fields or required fields already contain data, the system will not display the approval content popup but instead shows the approval comment popup to complete the approval process.
- For workflow layout configurations of approval content: When there are no required fields and no source objects, the system will not redirect to the approval content page but instead shows the approval comment popup to complete the approval process.
- If this API is executed in PWC, the approval content popup/page will be opened/redirected in the above scenarios.
# Parameters
| Parameter | Description | Type |
|---|---|---|
| isForceShowEditForm | true: Force open the edit content popup/page false: Do not force open the edit content popup/page | Boolean |
# Parameter Code Example
forceShowEditForm: true
# Code Example
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
let self = this;
return [{
/**
* Set externally exposed methods for plugins
* Whether to force entering the form page (forceShowEditForm) when the workflow has forms
*/
event: "flow.approval.edit.form.render.before",
functional: async function (context, options) {
return Promise.resolve({
// When return value is true, force entering the form page
forceShowEditForm: true
});
}
}]
}
}
}
