LimeObjectCondition: Condition<LimeObject> & {
    type: "limeobject";
}

A specialized condition type for evaluating LimeObject instances.

LimeObject conditions are the most common type of condition, used to control UI elements based on the state of business objects (deals, contacts, companies, etc.). The evaluate function receives a LimeObject and can check any of its properties to determine if the condition is met.

Example

Condition based on object status

const registry = platform.get(PlatformServiceName.ConditionRegistry);

const isDealActive = {
id: 'deal.is-active',
type: 'limeobject',
evaluate: (deal) => {
return deal.dealstatus === 'qualification' ||
deal.dealstatus === 'proposal';
}
};

registry.addCondition(isDealActive);

const condition = registry.getCondition('deal.is-active');
const isActive = condition.evaluate(deal);

Example

Condition for conditional action visibility

const canSendEmail = {
id: 'contact.can-send-email',
type: 'limeobject',
evaluate: (contact) => contact.email && contact.email.length > 0
};

const sendEmailAction = {
label: 'Send Email',
icon: 'envelope',
command: { name: 'send-email' },
condition: canSendEmail
};

See