Custom Fields
albert.resources.custom_fields
FieldType
ServiceType
The service type the custom field is associated with
Attributes:
Name | Type | Description |
---|---|---|
INVENTORIES |
|
|
LOTS |
|
|
PROJECTS |
|
|
TASKS |
|
|
USERS |
|
|
PARAMETERS |
|
|
DATA_COLUMNS |
|
|
DATA_TEMPLATES |
|
|
PARAMETER_GROUPS |
|
FieldCategory
EntityCategory
The entity category of the custom field. Only some categories are allowed for certain services
Attributes:
Name | Type | Description |
---|---|---|
FORMULAS |
|
|
RAW_MATERIALS |
|
|
CONSUMABLES |
|
|
EQUIPMENT |
|
|
PROPERTY |
|
|
BATCH |
|
|
GENERAL |
|
UIComponent
CustomField
Bases: BaseResource
A custom field for an entity in Albert.
Returns:
Type | Description |
---|---|
CustomField
|
A CustomField that can be used to attach Metadata to an entity in Albert. |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the custom field. Cannot contain spaces. |
id |
str | None
|
The Albert ID of the custom field. |
field_type |
FieldType
|
The type of the custom field. Allowed values are |
display_name |
str
|
The display name of the custom field. Can contain spaces. |
searchable |
bool | None
|
Whether the custom field is searchable, optional. Defaults to False. |
service |
ServiceType
|
The service type the custom field is associated with. |
hidden |
bool | None
|
Whether the custom field is hidden, optional. Defaults to False. |
lookup_column |
bool | None
|
Whether the custom field is a lookup column, optional. Defaults to False. Only allowed for inventories. |
lookup_row |
bool | None
|
Whether the custom field is a lookup row, optional. Defaults to False. Only allowed for formulas in inventories. |
category |
FieldCategory | None
|
The category of the custom field, optional. Defaults to None. Required for list fields. Allowed values are |
min |
int | None
|
The minimum value of the custom field, optional. Defaults to None. |
max |
int | None
|
The maximum value of the custom field, optional. Defaults to None. |
entity_categories |
list[EntityCategory] | None
|
The entity categories of the custom field, optional. Defaults to None. Required for lookup row fields. Allowed values are |
ui_components |
list[UIComponent] | None
|
The UI components available to the custom field, optional. Defaults to None. Allowed values are |
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"EntityCategory": {
"description": "The entity category of the custom field. Only some categories are allowed for certain services",
"enum": [
"Formulas",
"RawMaterials",
"Consumables",
"Equipment",
"Property",
"Batch",
"General"
],
"title": "EntityCategory",
"type": "string"
},
"FieldCategory": {
"description": "The ACL level of the custom field",
"enum": [
"businessDefined",
"userDefined"
],
"title": "FieldCategory",
"type": "string"
},
"FieldType": {
"description": "The type (list or string) of the custom field",
"enum": [
"list",
"string",
"number"
],
"title": "FieldType",
"type": "string"
},
"ServiceType": {
"description": "The service type the custom field is associated with",
"enum": [
"inventories",
"lots",
"projects",
"tasks",
"users",
"parameters",
"datacolumns",
"datatemplates",
"parametergroups"
],
"title": "ServiceType",
"type": "string"
},
"Status": {
"description": "The status of a resource",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
},
"UIComponent": {
"description": "The UI component available to the custom field",
"enum": [
"create",
"details"
],
"title": "UIComponent",
"type": "string"
}
},
"description": "A custom field for an entity in Albert.\n\nReturns\n-------\nCustomField\n A CustomField that can be used to attach Metadata to an entity in Albert.\nAttributes\n------\nname : str\n The name of the custom field. Cannot contain spaces.\nid : str | None\n The Albert ID of the custom field.\nfield_type : FieldType\n The type of the custom field. Allowed values are `list` and `string`. String fields cannot be searchable and are used to set uncontrolled metadata. List fields can be searchable and are used to set controlled metadata.\ndisplay_name : str\n The display name of the custom field. Can contain spaces.\nsearchable : bool | None\n Whether the custom field is searchable, optional. Defaults to False.\nservice : ServiceType\n The service type the custom field is associated with.\nhidden : bool | None\n Whether the custom field is hidden, optional. Defaults to False.\nlookup_column : bool | None\n Whether the custom field is a lookup column, optional. Defaults to False. Only allowed for inventories.\nlookup_row : bool | None\n Whether the custom field is a lookup row, optional. Defaults to False. Only allowed for formulas in inventories.\ncategory : FieldCategory | None\n The category of the custom field, optional. Defaults to None. Required for list fields. Allowed values are `businessDefined` and `userDefined`.\nmin : int | None\n The minimum value of the custom field, optional. Defaults to None.\nmax : int | None\n The maximum value of the custom field, optional. Defaults to None.\nentity_categories : list[EntityCategory] | None\n The entity categories of the custom field, optional. Defaults to None. Required for lookup row fields. Allowed values are `Formulas`, `RawMaterials`, `Consumables`, `Equipment`, `Property`, `Batch`, and `General`.\nui_components : list[UIComponent] | None\n The UI components available to the custom field, optional. Defaults to None. Allowed values are `create` and `details`.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null
},
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"type": {
"$ref": "#/$defs/FieldType"
},
"labelName": {
"default": null,
"title": "Labelname",
"type": "string"
},
"search": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Search"
},
"service": {
"$ref": "#/$defs/ServiceType"
},
"hidden": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Hidden"
},
"lkpColumn": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Lkpcolumn"
},
"lkpRow": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Lkprow"
},
"category": {
"anyOf": [
{
"$ref": "#/$defs/FieldCategory"
},
{
"type": "null"
}
],
"default": null
},
"min": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Min"
},
"max": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Max"
},
"entityCategory": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/EntityCategory"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Entitycategory"
},
"ui_components": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/UIComponent"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Ui Components"
},
"required": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Required"
},
"multiselect": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Multiselect"
},
"pattern": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Pattern"
},
"default": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default"
}
},
"required": [
"name",
"type",
"service"
],
"title": "CustomField",
"type": "object"
}
Fields:
-
status
(Status | None
) -
created
(AuditFields | None
) -
updated
(AuditFields | None
) -
name
(str
) -
id
(str | None
) -
field_type
(FieldType
) -
display_name
(str
) -
searchable
(bool | None
) -
service
(ServiceType
) -
hidden
(bool | None
) -
lookup_column
(bool | None
) -
lookup_row
(bool | None
) -
category
(FieldCategory | None
) -
min
(int | None
) -
max
(int | None
) -
entity_categories
(list[EntityCategory] | None
) -
ui_components
(list[UIComponent] | None
) -
required
(bool | None
) -
multiselect
(bool | None
) -
pattern
(str | None
) -
default
(str | None
)
Validators:
confirm_field_compatability
confirm_field_compatability() -> CustomField