Skip to content

@lubusin/wp-frappe-data-store / loadDocTypeDefinition

Function: loadDocTypeDefinition() ​

loadDocTypeDefinition(request, doctype): Promise<DocTypeDefinition>

Defined in: src/doctype.ts:125

Asynchronously fetches, normalizes, and caches field metadata for a given Frappe DocType. Filters out layout breaks/buttons and maps Frappe field types to simple UI widget types (text, select, date, etc.).

Parameters ​

request ​

FrappeRequest

The Frappe request transport function.

doctype ​

string

The Frappe DocType name (e.g., 'Task').

Returns ​

Promise<DocTypeDefinition>

Normalized DocTypeDefinition containing fields and title field ID.

Released under the MIT License.