AI Architecture Patterns
Overview
Overview
How to implement AI tool calling (function calling) in Salesforce Apex, working around the DML-before-callout transaction limitation with a multi-transaction follow-up pattern.
How to safely implement bidirectional field synchronization between integration APIs and UI users without creating infinite trigger loops.
Using dual self-referencing lookup fields to build multi-generation record traceability for clone, split, and versioning operations.
How to architect multi-step conversational workflows through system prompt engineering and Custom Metadata, keeping flow logic declarative and deployable without code changes.
How to use Platform Events and PlatformEventSubscriberConfig to execute license-restricted operations on behalf of portal or community users.
How Database.upsert() with external ID fields prevents duplicate record creation in concurrent integration scenarios, and when additional concurrency controls are needed.
How rounding errors accumulate in proportional calculations across partial credit and refund scenarios, and strategies to detect and correct them.
Using Custom Metadata Types to drive field mappings between source and target objects, eliminating hard-coded field references and enabling admin-managed integrations.
How to structure trigger handler logic in multiple passes when later fields depend on earlier fields being resolved first.
Architecture pattern where a parent component owns all state and children communicate via custom events, preventing data inconsistency in complex UIs with multiple interacting components.