- SalesforceChaCha
- Posts
- ๐ Do the impossible with Salesforce Functions๐บ
๐ Do the impossible with Salesforce Functions๐บ
What even is this feature ๐ค
Good morning, Salesforce Nerds! Raise your hand if youโve been burned by a governor limit! ๐๏ธ๐๏ธ๐๏ธ
As Salesforce professionals we all know the havoc that these limits can unleash for our teams. ๐ซ They can be SUPER difficult to troubleshoot & root cause. Not to mention they can stop an implementation in its tracks if theyโre not accounted for early. ๐
As requirements pour in from the business (with no concern for our plight ๐ญ), it helps to know what tools our favorite SaaS provider ๐คฉ has made available that allow us to:
โ Meet those computationally heavy ๐๏ธ business requirements
โ Give the finger ๐ to some governor limits
โ Play ๐ with some cool tech ๐

Agenda for today includes
Do the impossible with Salesforce Functions
Daily Principle
All the Memes
Do the impossible with Salesforce Functions
โ๏ธ What are Salesforce Functions?
If you check out the official Salesforce Function dev guide youโll read that Salesforce Functions allow you write code that executes โoutsideโ of your org. ๐คฏ ๐คฏ
Huh? So, wait โฆ we write Apex that executes outside of our org? ๐ค
Partly correct. It does run outside of your org! ๐ฅณ But, itโs not Apex! ๐
Salesforce Functions currently support Java, JavaScript, and TypeScript. ๐ฅ Meaning, your team(s) can now use an industry-standard language to create even more valuable experiences for your business! ๐ฅ๐ฅ
These functions are deployed to, and execute in, a secure Salesforce-managed infrastructure that is separate from your Salesforce org! ๐ง
Since they execute outside of your instance - they bypass governor limits! ๐๐
โ๏ธ How do I use Salesforce Functions?
Pretty simply, actually. ๐ Kind of like an AWS Lambda Function tbh.
Use VSCode to develop your function, deploy it to the Salesforce Function Infrastructure, invoke it. Easy, peasy, ๐-squeezy, right?
Yeah, youโre right. Thatโs super high-level and very happy-pathy, but those are the steps! ๐ฏ Validate it here!
At the end of the day, the function itself is included in your project files ๐ (with your Apex, LWC, VF, etc.), but itโs deployed into a managed environment that is accessible via your org with Apex or Flows! ๐
Itโs effectively a Function-as-a-service (FaaS) that you can call from Salesforce and it can call back into your org natively! ๐คฏ
โ๏ธ When do I use Salesforce Functions?
Theyโre perfect candidates for computationally-intense tasks that you just canโt do with Apex. โ
Think of those governor limits that can keep you up at night when youโre working on a solution. ๐ These may be a good candidate to refactor into a Function.
Need to do read a large CSV file ๐ and stream the contents into an Object in your org? A Function can do that. Maybe upload an image and resize it before saving it as a ContentVersion? Salesforce Functions to the rescue! ๐ฆธ
There are TONS of use cases. Really, any computation that would blow up a governor limit ๐งจ or is technically impossible on the platform (see the file examples above ๐๏ธ) may be better a Function.
โ๏ธ Where do I get more information?
For sure, check out the Developer Guide! Itโs packed with goodies - Quick Start, Samples, Architecture Overview, etc.. ๐
The Salesforce team has also provided some good, short videos on YouTube to demo and discuss details. Hereโs one. Hereโs another. This one is probably my fav. ๐
Happy coding, fellow Salesforce Nerds! ๐ค
Daily Principle
"If you are ever tempted to look for outside approval realize that you have compromised your integrity. If you need a witness, be your own."
and now....Your Daily Memes



What did you think about today's newsletter? |