🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators maxLength

Returns the maximum length allowed for a string attribute.

It is useful for cutting a string to fit an attribute and avoiding SQL errors when saving.

Example

Given a Class Car with a string attribute Name:

Car.allInstances->first.Name.maxLength

This will return the maximum length for the string attribute Name.

See: String attribute overflowing