Skip to main content

system.mes.personnel.validatePerson

Description

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

Syntax

system.mes.personnel.validatePerson(**person_data)

Parameters

ParameterTypeNullableDescription
departmentIdString (ULID)TrueThe ULID of the department this person is assigned to.
departmentNameStringTrueThe name of the department.
departmentPathStringTrueThe path of the department.
personStatusString (Enum)FalseThe status of the person (ACTIVE or INACTIVE). Default Value is ACTIVE
firstNameStringFalseThe first name of the person.
lastNameStringFalseThe last name of the person.
initialsStringTrueThe initials of the person.
usernameStringFalseThe username of the person.
idString (ULID)TrueThe ULID of the person (optional, used for updating an existing person).
notesStringTrueNotes related to the person.
enabledBooleanTrueIndicates if the person 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

person = system.mes.personnel.newPerson()
person['firstName'] = 'John'
person['lastName'] = 'Doe'
person['username'] = 'jdoe'
person['departmentId'] = '01JAP8R5RT-3FPXQABY-7KQZT6VF'
violations = system.mes.personnel.validatePerson(**person)