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

    Interface UserCoworker

    Reference to a user's associated coworker business object.

    In Lime CRM, user accounts (for authentication) are often separate from coworker/employee records (business objects with additional data). This interface provides the link between the two, allowing you to load the full coworker record when needed.

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

    const application = platform.get(PlatformServiceName.Application);
    const objects = platform.get(PlatformServiceName.LimeObjectRepository);
    const logger = createLogger('my-component');

    const user = application.getCurrentUser();

    if (user?.coworker) {
    // Usually 'coworker' or 'employee'
    const coworker = await objects.loadObject(
    user.coworker.limetype,
    user.coworker.id,
    { properties: ['phone', 'department'] }
    );

    logger.info(`Phone: ${coworker?.getValue('phone')}`);
    logger.info(`Department: ${coworker?.getValue('department')}`);
    }
    interface UserCoworker {
        id: number;
        limetype: string;
    }
    Index

    Properties

    Properties

    id: number

    The ID of the coworker LimeObject.

    Use this with LimeObjectRepository to load the full coworker record.

    limetype: string

    The name of the Limetype used for coworker records.

    Typically "coworker" or "employee", but can vary by configuration. Use this as the limetype parameter when loading the object.