Asset types
List CRM2 asset custom fields
/a/AssetTypes_getCustomFields
List custom asset fields defined in type-specific CRM2 layout groups.
When to use this endpoint
Use AssetTypes_getCustomFields when a CRM2 form, Asset export, or Assets module needs current layout-backed custom field IDs and labels.
For legacy fields stored in asset_types.meta.template, use AssetTypes_listCustomFields.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
condense_shared | Integer string | No | Exact integer 1 keeps only the first row for each metadata id. Other values return every layout occurrence. Despite the name, deduplication applies to shared and non-shared IDs alike. |
Example request
$fields = FM_api('AssetTypes_getCustomFields', [
'condense_shared' => '1',
]);
Example response
[
{
"id": "inspection_class",
"name": "Inspection class",
"label": "Inspection class",
"type": "select",
"asset_type": "Compressor",
"shared": 1,
"groupName": "Asset Type Custom Details - Compressor"
}
]
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Only layout rows with
type="custom"are included, and only groups whose metadata contains an asset-type ID joined to a current type. - Rows are initially selected by asset-type name and field name, then sorted only by numeric
shared; relative order within the same shared value is not a documented contract. - Field
idandsharedcome from parsed layout metadata. Missing keys can yield null/default values and runtime notices rather than a validation error. - There is no filtering by type ID and no pagination.
See it in Fieldmotion
CRM1
No production CRM1 caller was found; CRM1 uses AssetTypes_listCustomFields.
CRM2
Open the Assets export field picker, configure Asset fields on a Form, or open the CRM2 Assets module’s custom-field tools and filter Network requests for AssetTypes_getCustomFields.
Related endpoints
AssetType_getCustomLayoutresolves or creates the layout groups read here.AssetTypes_listCustomFieldsreads the older metadata-backed definitions.