Functions
# Create / Edit / Clone Pages Detail Page (Canvas) Detail Page (Standard)
getApiName() → {String}
Get the API name of subform
api_name
Examples
SampleCopycopied
var field_obj = ZDK.Page.getSubform('CFSubform');
field_obj.getApiName();
Output
CFSubform
# Create / Edit / Clone Pages Detail Page (Canvas) Detail Page (Standard)
getField(api_name) → {SubformField}
Get the Subform Field by api name
Parameters:
Name | Type | Description |
---|---|---|
api_name |
String | Api Name of field |
SubformField object
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').getField('Account');
# Create / Edit / Clone Pages
setValues(values)
Set the Subform values in the subform
Parameters:
Name | Type | Description |
---|---|---|
values |
Array | Subform values, An array of objects, where each object contains field api_names and its values in a row as key-value pairs |
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').setValues([{'Name': 'Zylker', 'Age': '20', ...}, {...}, ...]);
# Create / Edit / Clone Pages Detail Page (Canvas) Detail Page (Standard)
getValues() → {Array}
Get the Subform values
Subform values
Examples
SampleCopycopied
ZDK.Page.getSubform('CFSubform').getValues();
Output
[{'Name': 'Zylker', 'Age': '20', ...}, {...}, ...]
# Create / Edit / Clone Pages Detail Page (Canvas) Detail Page (Standard)
getRow(index) → {SubformRow}
Get the single row of subform as Object
Parameters:
Name | Type | Description |
---|---|---|
index |
Number | Index row of subform, indexing starts from 0 |
SubformRow Single row of subform as Subform Row object or null if row doesn't exists
Examples
SampleCopycopied
ZDK.Page.getSubform('CFSubform').getRow(index).getValues();
Output
{'Name': 'Zylker', 'Age': '20', ...}
# Create / Edit / Clone Pages
insertRows(values, index)
Inserts the input subform rows from the specified index
Parameters:
Name | Type | Description |
---|---|---|
values |
Array | Set of row values as Array |
index |
Number | Starting Index of the row to be inserted |
Examples
Insert at specified indexCopycopied
ZDK.Page.getSubform('CFSubform').insertRows([{'Name': 'Zylker', 'Age': '20', ...}, {...}, ...], index);
AppendCopycopied
ZDK.Page.getSubform('CFSubform').insertRows([{'Name': 'Ibro', 'Age': '21', ...}, {...}, ...]);
# Create / Edit / Clone Pages
deleteRow(index)
Deletes the specified index row of subform
Parameters:
Name | Type | Description |
---|---|---|
index |
number | Index of the row to be deleted |
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').deleteRow(index);
# Create / Edit / Clone Pages
clear()
Clears the subform data
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').clear();
# Create / Edit / Clone Pages
setMandatory(value)
Set the Subform as mandatory
Parameters:
Name | Type | Description |
---|---|---|
value |
Boolean | mandatory property (true|false) |
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').setMandatory(true);
# Create / Edit / Clone Pages
addInfo(message)
Set the info icon for Subform
Parameters:
Name | Type | Description |
---|---|---|
message |
String | message/info to be added |
Example
SampleCopycopied
ZDK.Page.getSubform('CFSubform').addInfo("Show tooltip");