Skip to main content

system.mes.personnel.validateDepartment

Description

Validates the specified parameters for a Personnel Department record and returns any validation errors. This only checks if the department object can be saved based on the attributes given.

Syntax

system.mes.personnel.validateDepartment(**department_data)

Parameters

ParameterTypeNullableDescription
nameStringFalseThe name of the department.
descriptionStringTrueThe description of the department.
pathStringTrueThe path to the department.
parentIdString (ULID)TrueThe ULID of the parent department to this department.
idString (ULID)TrueThe ULID of the department (optional, used for updating an existing department).
notesStringTrueNotes related to the department.
enabledBooleanTrueIndicates if the department is active and enabled.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages.

Code Examples

department = system.mes.personnel.newDepartment()
department['name'] = 'Engineering'
violations = system.mes.personnel.validateDepartment(**department)