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

    Interface LimeType

    Represents a Lime type definition in the Lime CRM system.

    A LimeType defines the schema and metadata for a business object type (e.g., company, person, deal). It contains information about properties, access control, labels, and provides methods to navigate the type structure including related types through property relations.

    LimeTypes are the foundation of the type system and describe:

    • What properties an object of this type has (see LimeProperty)
    • How those properties relate to other types
    • Access control rules (Acl) for the type
    • Localized names, and a label marking special-purpose types
    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const dealType = repository.getLimeType('deal');

    if (dealType) {
    console.log('Display name:', dealType.localname.singular);
    console.log('Properties:', Object.keys(dealType.properties));
    console.log('Can update:', dealType.acl.update);
    }
    interface LimeType {
        acl: Acl;
        label: string;
        localname: { plural: string; singular: string };
        name: string;
        properties: Record<string, LimeProperty>;
        getProperty(name: string): LimeProperty;
    }
    Index

    Properties

    acl: Acl

    Access control list defining permissions for this type. Determines what operations (read, write, delete, etc.) are allowed. See Acl for details on permission structure.

    label: string

    Label marking this limetype for a specific system usage, e.g. company, person, or deal.

    A limetype's name can be anything a schema defines, so label is how the system recognizes a type's special-purpose role independent of its name. There are many more labels than the common examples, defined by Lime CRM or by the installation's configuration; most limetypes have none.

    Use localname.singular or localname.plural for user-facing text.

    localname: { plural: string; singular: string }

    Localized names for the limetype. Contains both singular and plural forms based on current user language.

    Type Declaration

    • plural: string

      Plural form (e.g., 'Companies', 'People')

    • singular: string

      Singular form (e.g., 'Company', 'Person')

    name: string

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

    properties: Record<string, LimeProperty>

    Map of all properties defined on this limetype. Key is the property name, value is the LimeProperty definition.

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

    const repository = platform.get(PlatformServiceName.LimeTypeRepository);
    const limetype = repository.getLimeType('person');

    const nameProperty = limetype?.properties['name'];
    const allPropertyNames = Object.keys(limetype?.properties ?? {});

    Methods

    • Get a property by name, with support for navigating relations using dot notation.

      This method allows you to retrieve property definitions, including properties on related objects. When you specify a path like 'company.phone', it will:

      1. Get the 'company' property from this limetype
      2. Follow the relation to the company limetype
      3. Return the 'phone' property from the company limetype

      Parameters

      • name: string

        Name of property to get. Can use dot notation to traverse relations (e.g., 'company.phone' to get phone property of related company)

      Returns LimeProperty

      The property definition for the specified property

      Will throw an error containing the name of the missing property if the property does not exist

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

      const repository = platform.get(PlatformServiceName.LimeTypeRepository);
      const dealType = repository.getLimeType('deal');

      if (dealType) {
      const nameProperty = dealType.getProperty('name');
      console.log(nameProperty.type); // 'string'

      // Dot notation follows the relation to the company type
      const phoneProperty = dealType.getProperty('company.phone');
      console.log(phoneProperty.type); // 'phone'
      console.log(phoneProperty.localname); // 'Phone'

      const contactNameProperty = dealType.getProperty('contact.name');
      if (contactNameProperty.required) {
      console.log('Contact name is required');
      }
      }