English
flow.approval.detail.related.render.before
About 303 wordsAbout 1 min
2026-06-04
flow.approval.detail.related.render.before
Description: This hook is used to rewrite rendering styles before related objects on the approval detail page are rendered.
Feature Description
- Rewrites rendering styles before related objects on the approval detail page are rendered. Column styles can be customized through fieldsStyles or methods.getFieldsStyles().
Parameters
| Parameter | Description | Type |
|---|---|---|
| controlArg | Object data apiName, id, and other information | Object |
| detailObjects | Related object data | Array |
Return Value
| Parameter | Description | Type |
|---|---|---|
| methods | Method collection, including getFieldsStyles() | Object |
| fieldsStyles | Field style configuration, functionally equivalent to methods.getFieldsStyles() | Object |
fieldsStyles Configuration Description
| Property | Description | Type |
|---|---|---|
| column_width | Column width | Number |
| text_style | Text style | String |
| max_lines | Maximum number of lines. 0 means unlimited | Number |
| header_text_style | Text style appended only to the header | String |
| value_text_style | Text style appended only to the body/value | String |
The * wildcard can be used to set global styles, and a field api_name can be used to set styles for a specific field.
Parameter Code Example
let controlArg = options && options.controlArg;
let detailObjects = options && options.detailObjects;Code Example
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
return [
{
event: "flow.approval.detail.related.render.before",
functional: async function (context, options) {
let controlArg = options && options.controlArg;
let detailObjects = options && options.detailObjects;
return Promise.resolve({
methods: {
getFieldsStyles() {
// This method provides the same capability as directly returning fieldsStyles below; the returned data is consistent with fieldsStyles
return {
'*': {
column_width: 70,
text_style: 'font-size:10px;line-height:14px;white-space:normal;word-break:break-word;',
max_lines: 0,
// Append only to the header
header_text_style: 'font-weight:700;',
// Append only to the body/value
value_text_style: 'color:#545861;'
},
// Field api_name
last_modified_time: {
column_width: 100
}
};
}
},
fieldsStyles: {
'*': {
column_width: 70,
text_style: 'font-size:10px;line-height:14px;white-space:normal;word-break:break-word;',
max_lines: 0,
// Append only to the header
header_text_style: 'font-weight:700;',
// Append only to the body/value
value_text_style: 'color:#545861;'
},
// Field api_name
last_modified_time: {
column_width: 100
}
}
});
}
}
];
}
};
};