attributesUpdateDefinition
Renames, describes, archives or restores a custom field of one kind of record. Only the arguments given change.
Business Rules
- The definition is looked up within the company in the
X-Company-Idheader and the kind of record inentityType - The name and the handle stay unique among the company’s definitions for that kind of record, archived ones included
delete: truearchives the definition and hides its values;restore: truebrings them back, and the two cannot be combineddelete: trueis applied before the rest of the request: a field that cannot be null is still rejected, and every other value sent with it is discarded without being checkedattributeTypeandentityTypecannot be changed
Error Scenarios
- **
BAD_REQUEST**: the definition belongs to another company or another kind of record, or no change is given at all - **
BAD_REQUEST**:deleteandrestoreare both true, a definition that is not archived is restored, or an archived definition is archived again - **
BAD_REQUEST**: the name or the handle is blank, too long, malformed, or held by another definition, or the attribute group is longer than 100 characters - **
BAD_REQUEST**:name,handleor one of the three settings is sent as null, which is rejected rather than ignored, and beforedeleteis considered - **
CompanyContextRequired**: no company is in context
Permissions Required
- The update permission of the entity type, such as
products:update_attribute_definitionforPRODUCT
attributesUpdateDefinition(
input: AttributesUpdateDefinitionInput!
): AttributeDefinition!
Arguments
attributesUpdateDefinition.input ● AttributesUpdateDefinitionInput! non-null input common
Parameters for AttributesUpdateDefinition
Type
AttributeDefinition object common
A custom field that can be set on a record, such as “Material” on a product.