English
detail.multitable.render.before
About 619 wordsAbout 2 min
2025-12-16
This hook is called before rendering a child-object table on the detail page.
Parameters
functional registers the hook callback. The host passes the following parameters:
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| context | Event context containing common parameters | Object | -- | -- |
| plugin | Current plugin runtime information; business logic normally does not need it | Object | -- | -- |
| context.targetObjectApiName | API name of the child object | String | -- | -- |
Return Value
The hook may return a configuration object or Promise<Object>.
| Parameter | Description | Type | Default |
|---|---|---|---|
| columnsExtendConfig | Column extension configuration | Object | -- |
| termExtendConfig | Scenario extension configuration | Object | -- |
| viewInfoExtendConfig | View extension configuration | Object | -- |
| actionExtendConfig | Button behavior extension | Object | -- |
| formatListDataAsync | Processes current-page List API data | Function | -- |
| formatRequestParam | Processes List API request parameters | Function | -- |
| forceTrWrap | Whether cells forcibly wrap | Boolean | -- |
| buttons | Toolbar button configuration | Object | -- |
| operateBtns | Row action extension functions | Function[] | -- |
columnsExtendConfig
| Parameter | Description | Type | Default |
|---|---|---|---|
| filterColumns | Fields hidden from the table, table settings, and filters | Array | -- |
| render | Custom cell render functions | Object | -- |
| attrs | Cell attribute extensions | Object | -- |
columnsExtendConfig.render
The render function signature is render(value, type, data, index). The host uses it directly as the table column render function.
| Parameter | Description | Type |
|---|---|---|
| value | Raw field value before default formatting | Any |
| type | Normally column; some partial updates pass the current column object | String | Object |
| data | Complete row data | Object |
| index | Row index within the current page | Number |
Returned strings are rendered as cell HTML. Escape raw values before including them in HTML.
columnsExtendConfig.attrs
An attrs key may be a field API name, returnType, or dataType. A field API name takes precedence.
| Parameter | Description | Type | Default |
|---|---|---|---|
| showLookupText | Shows lookup text without a link | Boolean | -- |
| isEdit | Enables cell editing | Boolean | -- |
| noSupportBatchEdit | Disables batch editing | Boolean | -- |
| disabledDel | Disables clearing the field value | Boolean | -- |
| fixed | Fixes the column to the left | Boolean | -- |
termExtendConfig and viewInfoExtendConfig
termExtendConfig.default is the default scenario API name, and termExtendConfig.retain contains scenario API names or IDs to retain. viewInfoExtendConfig.default selects the default view.
actionExtendConfig
Keys are case-sensitive runtime actions. parseParam(params) returns properties shallow-merged into button execution parameters. beforeRowAction(params) must return a Promise; resolution continues the default action and rejection stops it.
formatListDataAsync
formatListDataAsync(listData) receives { totalCount, data } and must preserve that structure. It may return an object or Promise<Object>.
formatRequestParam
formatRequestParam(params) receives complete List API request parameters. Return an object to shallow-merge changes, or mutate params and return nothing.
buttons
buttons supports add, del, and reset. An added button requires action and label; use callback(), exposed, and placement: { base, relative } as needed. child-table toolbar callbacks receive no arguments; read record or object information from the enclosing hook context.
operateBtns
operateBtns is an array of (rowData) => ({ add, del, reset, retain }) functions. Custom row buttons require action, label, and callback(params). The callback receives the complete row-action parameters.
Basic Examples
Hide a Column
return Promise.resolve({
columnsExtendConfig: {
filterColumns: ['name']
}
});Customize Cell Content
return Promise.resolve({
columnsExtendConfig: {
render: {
owner: (value, type, data, index) => 'Hello'
}
}
});Set the Default Scenario
return Promise.resolve({
termExtendConfig: {
default: 'All',
retain: ['All', 'InCharge']
}
});Extend Button Parameters
return Promise.resolve({
actionExtendConfig: {
add: {
parseParam: () => ({
record_type: 'default__c',
success() {
context.bizApi.refresh();
}
})
}
}
});Extend List Request Parameters
return Promise.resolve({
formatRequestParam(params) {
const searchQueryInfo = JSON.parse(params.search_query_info);
searchQueryInfo.filters = searchQueryInfo.filters || [];
searchQueryInfo.filters.push({
field_name: 'name',
field_values: ['value'],
operator: 'LIKE'
});
return {
search_query_info: JSON.stringify(searchQueryInfo)
};
}
});Add a Toolbar Button
return Promise.resolve({
buttons: {
add: [{
action: 'cancel',
label: 'Cancel',
callback() {
console.log(context.objectApiName);
}
}]
}
});Add a Row Action
return Promise.resolve({
operateBtns: [
rowData => ({
add: [{
action: 'customRowAction',
label: 'Custom Row Action',
callback(params) {
console.log(rowData, params.data);
}
}]
})
]
});FAQ
Q: Why does the next page fail to update when formatListDataAsync changes request parameters?
A: formatListDataAsync processes current-page response data. Use formatRequestParam to change limit, offset, or other request parameters.
