Skip to main content

Posts

Tech Basics

Explore practical guides and implementation patterns for this topic.

Master Salesforce Governor Limits: SOQL, CPU Timeouts, and Apex Best Practices
Salesforce Basics

Master Salesforce Governor Limits: SOQL, CPU Timeouts, and Apex Best Practices

๐Ÿ’ฌ In plain words: Governor limits are like the referee in a shared stadium. Every time you run a transaction, Salesforce gives you a strict budget: a set number of database queries, DML statements, CPU time, and memory. This ensures no single tenant can hog the servers and crash the platform. You cannot fight limits; you must design for them by bulkifying your code, caching data, and moving heavy lifting to asynchronous processes. ๐Ÿ“Œ Example: The Scaling Problem Imagine a simple "Sync All Contacts" button. It worked perfectly for small boutique clients with a few hundred contacts. But when a bank with 80,000 contacts clicked it, the system threw an error: Too many query rows: 50001 . Governor limits didn't fail the developer—they acted as an alarm, signaling that this massive workload belongs in Batch Apex, not a real-time button click. ๐ŸŽฌ Real-Life Example: The Loop That Cost 101 Queries You write a trigger to enrich a Del...
Master Salesforce Scheduled Apex & The Flex Queue
Salesforce Basics

Master Salesforce Scheduled Apex & The Flex Queue

๐Ÿ’ฌ In plain words: Scheduled Apex acts as your org's cron job: "Run this class every night at 2 AM." The Apex Flex Queue is the waiting room for these jobs. Because Salesforce only allows 5 batch jobs to run concurrently, up to 100 additional jobs can sit patiently in the Flex Queue until a slot opens up. You schedule the class, and the platform handles the waiting room. ๐Ÿ“Œ The 2 AM Reminder Example: You need to send subscription renewal reminders daily at 2:00 AM. You write a Schedulable class and set a cron expression: 0 0 2 * * ? . When 2:00 AM hits, what if 9 other heavy batch jobs are already running? No problem. Your reminder job enters the Flex Queue (which holds up to 100 jobs) and waits until one of the 5 active slots becomes available. ๐Ÿง  Memory Aid: The Alarm Clock + The Waiting Room Scheduled Apex is the alarm clock . The Flex Queue is the waiting room (100 seats, 5 doors). Core Concept: How Scheduled Ap...
Master Salesforce Queueable Apex: Chaining, Finalizers, and Cursors
Salesforce Basics

Master Salesforce Queueable Apex: Chaining, Finalizers, and Cursors

๐Ÿ’ฌ In plain words: Queueable Apex is Salesforce's modern asynchronous worker. Unlike older methods, it accepts complex objects as parameters and returns a trackable Job ID. Best of all, it allows for chaining—one job can trigger the next, passing the baton like a relay race. By attaching a Transaction Finalizer , you build a safety net that guarantees specific code will run (for logging or retrying) even if the main job crashes. ๐Ÿ“Œ The Order Fulfillment Example: Imagine an order ships. Job 1 calls the courier API. Once complete, it enqueues Job 2 to update the inventory system. Job 2 then enqueues Job 3 to email the invoice. This is an organized relay race where every runner gets a fresh set of governor limits. If Job 2 crashes due to a limit exception, its Transaction Finalizer catches the failure, logs it, and re-queues the job to try again. ๐ŸŽฌ Real-Life Application: The Relay That Never Drops the Baton A company needs to process b...
ERP vs MES in Pharma Manufacturing: Core Differences Explained
MES

ERP vs MES in Pharma Manufacturing: Core Differences Explained

⚡ 1-Minute Summary ERP plans the business side of manufacturing, while MES executes the work on the factory floor. ERP tracks what is needed and what is in inventory, while MES records what actually happened during production. Both systems are connected, but you must define strict data ownership rules so they don't fight over the same information. Topic Map: Pharma Manufacturing Systems PHARMA MANUFACTURING SYSTEMS | +-- ERP (e.g., SAP) | +-- Business demand | +-- Product / material master | +-- Production order | +-- Planned quantity | +-- Inventory / costing | +-- Business dates | +-- MES | +-- Shop-floor execution | +-- Operator instructions | +-- Material verification | +-- Equipment / step execution | +-- Actual quantities | +-- Electronic manufacturing record | +-- INTEGRATION +-- ERP -> MES: Plan / order / master data +-- MES -> ERP: Actuals / completion / consumption ๐Ÿ’ฌ In plain words: ERP an...