Dynamic property access for object properties.
Properties are accessible via bracket notation, but prefer getValue instead for consistent and relation-aware access.
ISO 8601 timestamp when this object was created.
This is an audit field that records when the record was first created in the system. The timestamp includes date and time with timezone.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const limeObject = repository.getObject('company', 1234);
if (limeObject) {
const created = new Date(limeObject.createdtime);
console.log(`Created on: ${created.toLocaleDateString()}`);
}
Human-readable text representation of this object.
This is the display name shown in lists, dropdowns, and references. Calculated from labels set on the LimeType's properties. Can be a single field or a combination of multiple fields.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const company = repository.getObject('company', 1234);
const person = repository.getObject('person', 5678);
console.log(company?.descriptive); // "Acme Corporation"
console.log(person?.descriptive); // "John Doe" (firstname + lastname)
Unique identifier for this object.
The ID is a positive integer that uniquely identifies this record within its LimeType. IDs are auto-generated and immutable.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const limeObject = repository.getObject('company', 1234);
if (limeObject) {
console.log(`Object ID: ${limeObject.id}`); // "Object ID: 1234"
}
ISO 8601 timestamp of the last modification to this object.
Updated automatically whenever any property of the object changes.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const limeObject = repository.getObject('company', 1234);
if (limeObject) {
const updated = new Date(limeObject.timestamp);
const minutesAgo = (Date.now() - updated.getTime()) / 60_000;
console.log(`Last updated ${Math.floor(minutesAgo)} minutes ago`);
}
Get an attached file from a file property.
Returns the LimeFile object for file attachments. Use this to access file metadata (name, size, MIME type) and download URLs.
Name of the file property.
The LimeFile if a file is attached, undefined otherwise.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const limeObject = repository.getObject('deal', 1234);
const document = limeObject?.getFile('contract_pdf');
if (document) {
console.log(`File: ${document.filename}`);
console.log(`Size: ${document.size} bytes`);
console.log(`Extension: ${document.extension}`);
const downloadUrl = document.getUrl('download');
}
Get the LimeType definition for this object.
Returns the type definition containing schema information, property definitions, ACL rules, and other metadata about this object's type.
The LimeType definition.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const limeObject = repository.getObject('deal', 1234);
if (limeObject) {
const limetype = limeObject.getLimetype();
console.log(`Object type: ${limetype.name}`);
console.log(`Display name: ${limetype.localname.singular}`);
const canEdit = limetype.acl.update;
const nameProperty = limetype.getProperty('name');
console.log(`Name is required: ${nameProperty.required}`);
}
Get the value of a property using dot notation to navigate relations.
This method provides type-safe property access with support for navigating
through related objects. Use dot notation to traverse relations, e.g.,
company.address.city to get the city of a company's address.
This is the recommended way to access all properties, including simple values and relations.
Only properties that were loaded are returned. There is no lazy loading
today, so reading a property or a relation that was not loaded returns
undefined instead of fetching it. Ask for the paths you need up front
through LoadOptions.properties, using dot notation for values on
related objects.
Property name or path. Use dots to navigate relations.
The property value, or undefined if the property was not
loaded. For relations, returns the related LimeObject.
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const deal = repository.getObject('deal', 1234);
const name = deal?.getValue('name');
const status = deal?.getValue('status');
const value = deal?.getValue('value');
import { PlatformServiceName } from '@limetech/lime-web-components';
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
const deal = await repository.loadObject('deal', 1234, {
properties: ['name', 'company.name', 'contact.email'],
});
const companyName = deal?.getValue('company.name');
const contactEmail = deal?.getValue('contact.email');
// Not loaded above, so this is `undefined` rather than a fetch
const contactPhone = deal?.getValue('contact.phone');
LoadOptions.properties to choose which properties are loaded
Represents a business object instance in Lime CRM.
A LimeObject is an instance of a LimeType with actual data values. It contains the object's properties, metadata, and methods for accessing data including related objects. Use the
getValue()method to access properties — it supports dot notation for navigating relations.Key characteristics:
Example: Use a decorator to get the current object
Example: Access properties using getValue() with dot notation
Remarks
Only loaded properties are readable. Nested objects and properties are not lazy loaded, so decide which paths to load up front. See getValue.
The system fields
id,createdtime,timestamp, anddescriptivecome from LimeObjectSystemProperties. Property values are typed as LimeObjectValue.