Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Interface LimeProperty

    Represents a property definition on a LimeType.

    A LimeProperty describes a single field on a business object, including its data type, display metadata, and optionally its relationship to other types. Properties can be simple values (strings, numbers) or complex relations to other objects.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const nameProperty = repository.getLimeType('person')?.getProperty('name');

    console.log(nameProperty?.type); // 'string'
    console.log(nameProperty?.required); // true
    console.log(nameProperty?.localname); // 'Name'

    if (nameProperty?.acl.update) {
    console.log('User can edit this property');
    }
    interface LimeProperty {
        acl: Acl;
        defaultvalue?: LimeObjectValue | Option;
        fieldorder: number;
        has_sql?: boolean;
        label: string;
        length?: number;
        localname: string;
        name: string;
        options?: Option[];
        relation?: {
            getBackreference: () => LimeProperty;
            getLimetype: () => LimeType;
        };
        required: boolean;
        type: PropertyType;
    }
    Index

    Properties

    acl: Acl

    Access control list for this property. Determines what operations (read, write, delete, update) are allowed on this property. See Acl for details on permission structure.

    defaultvalue?: LimeObjectValue | Option

    The schema-defined default value for this property when creating a new limeobject. The runtime type matches the property's PropertyType (see LimeObjectValue).

    An option property is the exception: its default is the full Option, not the key string a stored option value holds.

    fieldorder: number
    has_sql?: boolean
    label: string

    Label marking this property for a specific system usage.

    A property's name can be anything a schema defines, so label is how the system recognizes a property's special-purpose role independent of its name, e.g. a property named email might carry the label primaryemailaddress. There are many such labels, defined by Lime CRM or by the installation's configuration; most properties have none.

    Use localname for display purposes.

    length?: number

    Maximum length for string-based properties. Only applicable to string, text, phone, and link types.

    localname: string

    Localized display name of the property for the current user's language. Use this value when displaying the property name in the UI.

    name: string

    Internal name of the property (e.g., 'name', 'phone', 'company'). This is the identifier used in API calls and code.

    options?: Option[]

    List of predefined options for 'option' or 'set' type properties. Represents dropdown/select values that users can choose from.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const statusProperty = repository.getLimeType('deal')?.getProperty('status');

    // Inactive options stay out of a dropdown for new selections
    const activeOptions =
    statusProperty?.options?.filter((option) => !option.inactive) ?? [];

    for (const option of activeOptions) {
    // `key` is the stored value, `text` is what the user reads
    console.log(option.key, option.text);
    }
    relation?: { getBackreference: () => LimeProperty; getLimetype: () => LimeType }

    Relation metadata for property types that link to other LimeTypes. Only present when type is 'hasone', 'hasmany', 'belongsto', or 'hasandbelongstomany'.

    Type Declaration

    • getBackreference: () => LimeProperty

      Get the property on the related LimeType that points back to this type. For example, if a deal has a 'company' property, the back-reference would be the 'deals' property on the company type.

    • getLimetype: () => LimeType

      Get the LimeType that this property relates to.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const companyProperty = repository.getLimeType('deal')?.getProperty('company');

    if (companyProperty?.relation) {
    const companyType = companyProperty.relation.getLimetype();
    console.log('Deals relate to:', companyType.name);

    // The inverse relationship
    const dealsProperty = companyProperty.relation.getBackreference();
    console.log('Back-reference:', dealsProperty.name); // e.g., 'deals'
    }
    required: boolean

    Indicates whether this property is required. When true, objects cannot be saved without a value for this property.

    The data type of this property. Determines how values are stored, validated, and displayed. See PropertyType for all available types.