The ID of the specific limeobject (record) in this context.
When set, indicates the component is viewing/editing a specific record.
When null, the component may be on a list view or creating a new record.
if (context.id) {
// Load and display the specific record
const object = await repo.loadObject(context.limetype, context.id);
} else {
// Show list view or new record form
}
The name of the LimeType for this context.
This identifies what type of business object the component is working with
(e.g., 'customer', 'contact', 'deal', 'invoice'). Can be null if the
component is not associated with a specific limetype.
if (context.limetype === 'customer') {
// Load customer-specific data and features
}
Optional parentOptional parent context when this component is nested within another.
Used when components are embedded in other components to maintain the relationship hierarchy. For example, a contact list component shown within a customer detail view would have the customer as its parent context.
// Check if running within another context
if (context.parent) {
console.log(`Nested within ${context.parent.limetype}`);
// Load data filtered by parent
if (context.parent.id) {
const relatedRecords = await loadRelatedToParent(context.parent);
}
}
Describes the context in which a Lime Web Component is running.
The context provides information about the current business object (limetype and ID) that the component is associated with. This allows components to load and interact with the relevant data based on where they are displayed in the application.
Contexts can be nested when components are embedded within other components, allowing for hierarchical relationships between different views.
Example
Example