💃 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."

Epictetus

and now....Your Daily Memes

What did you think about today's newsletter?

Login or Subscribe to participate in polls.