Cooking with Code: A Sweet Intro to SOQL (Part Three)

I LIKE SOQLWelcome back to another episode of “Cooking with Code” where I introduce delectable bite-sized topics related to coding in Salesforce.

Today, we are concluding our satisfying sampler of Salesforce Object Query Language (SOQL) with Part Three of this three part series.

My first post introduced the basics of SOQL statements, including the following concepts and keywords: SELECT, FROM, LIMIT, ORDER BY, basic WHERE conditions, and basic operators. My second post showed how to pull data from related standard and custom objects.

In this, my third and final post, we will delve deeper still into: aggregates, how to work with dates and times, and using advanced operators with wildcards.

Ooooh wheee! This is going to be fun! Let’s have at it!

Cooking with Code: A Sweet Intro to SOQL (Part Two)

Working with Related Objects in SOQL.Welcome back to another episode of “Cooking with Code” where I introduce delectable bite-sized topics related to coding in Salesforce.

Today, we are continuing our satisfying sampler of SOQL with Part Two of this three part series.

My first post introduced the basics of SOQL statements, including these concepts and keywords: SELECT, FROM, LIMIT, ORDER BY, basic WHERE conditions, and basic operators.

This, my second post, will show how we can pull data from related standard and custom objects using dot notation and subqueries.

In my third and final post I will delve deeper still, into aggregates, advanced operators and wildcards, working with dates and numbers, and more advanced WHERE conditions.

So let’s dive in and build on what we’ve learnt about SOQL.

Cooking With Code: A Sweet Intro to SOQL (Part One)

SOQL is used to query Salesforce objects and return record setsWelcome back to another episode of “Cooking with Code” where I introduce delectable bite-sized topics related to coding in Salesforce.

Today we are getting into a sweet subject that I can’t wait to share with you! This is the first of three posts where together we’ll tackle the basics of SOQL, or Salesforce Object Query Language. SOQL is used to pull data sets from Salesforce and can be used in both Apex and Visualforce. Fantastic stuff for Salesforce Admins to learn, because we’re all Data Geeks at heart. (Data Nerds Unite!)

In this first post, I’ll introduce the basics of SOQL statements, including these concepts and keywords: SELECT, FROM, LIMIT, ORDER BY, basic WHERE conditions, and basic operators.

In my second post, we’ll move into pulling data from related standard and custom objects using dot notation and subqueries.

In my third post, we’ll dive deeper into aggregates, advanced operators and wildcards, working with dates and numbers, and more advanced WHERE conditions.

This is not an exhaustive (nor hopefully, exhausting) guide to SOQL. It’s just the bits and bobs that I use most often, and that should be enough to get you started.

Learning to Code?

Below is a suggested reading order for those who are just starting to learn to code on Force.com. This doesn’t mean that you can’t skip around, but that if you’re brand new, you’ll have an easier time following this plan to some extent. I will fill more posts as I write them. Happy learning! Continue Reading

Cooking with Code: Oh … for the Love of FOR Loops

For Loops in ApexNow that we’ve got our head around how to work with SOQL to pull data sets out of our Salesforce org, it’s time to circle back to loops.

In a previous post, we walked through While and Do-While Loops (and we learned to make Pavlova, which I seem to be obsessed with these days). I mentioned that there was another type of loop; a For loop. That’s the topic of today’s blog post; a fantastically flavor-filled foray into For loops.

I can’t wait to show you how this works. We are getting so close to a full-on trigger that I can almost taste it (salty and tangy … like really good salt and vinegar chips. Yum!).

UPDATE (5/15/15) – I have added a third best practice for using a SOQL For Loop.