A command that operates on a single LimeObject.

LimeObjectCommand is used for actions that target a specific record, such as sending an email to a contact, generating a PDF for a deal, or archiving a specific company. The context property identifies which object the command should operate on.

Example

@Command({ id: 'send-email' })
export class SendEmailCommand implements LimeObjectCommand {
public context: LimeWebComponentContext & { limetype: string; id: number };
public subject: string;
public body: string;

constructor(
context?: LimeWebComponentContext & { limetype: string; id: number },
subject?: string,
body?: string
) {
this.context = context;
this.subject = subject;
this.body = body;
}
}

Example

// Execute a single-object command
const commandBus = platform.get(PlatformServiceName.CommandBus);

const command = new SendEmailCommand(
context,
'Meeting Invitation',
'Please join us for a meeting...'
);

await commandBus.handle(command);

Hierarchy

Implemented by

Properties

Properties

context: LimeWebComponentContext & {
    id: number;
    limetype: string;
}

Context describing the LimeObject the command will operate on.

Must include both limetype (the type of object) and id (the specific object's identifier). This ensures the command knows exactly which record to target.