Advanced Apex Programming 5th Edition now Available

I’m pleased to announce the immediate availability of the fourth edition of Advanced Apex Programming!

I know what you’re thinking – what has changed? Do I really need a new edition?

Well, the first thing you should know, is that this book is over 60 pages longer than the previous edition – but that alone does not convey the scope of the changes.

Here’s a brief summary of the major changes for this edition:

Chapter 3: New coverage of the Salesforce platform cache and query selectivity limits.

Chapter 4: Extended to include additional bulk design patterns in the context of enforcing data integrity and addressing data skew.

Chapter 6: This chapter has been completely rewritten with all new examples to incorporate new technologies and modern approaches for refactoring application functionality into decoupled applications or packages.

Chapter 7: The chapter and examples have been rewritten to address batch apex exception events and queueable transaction finalizers. Other new topics include the challenge of dealing with transactions in the context of callouts, suicide scheduling and change data capture.

Chapter 9: The section on working with custom metadata has been completely rewritten to reflect improvements in the technology. The Aura sample code has been reimplemented as Lightning web components.

Chapter 10: The chapter and examples have been updated to be based on the new trigger examples in chapter 6.

Chapter 12: Revised recommendations for unit tests and managed packages.

So even if you don’t buy this new edition, please don’t read the previous one – the platform has changed, and many of the earlier recommendations no longer reflect best practices. Especially when it comes to trigger design patterns!

By the way – the Kindle edition is still priced considerably lower than the print edition – so that offers an inexpensive way to check out what’s new without buying a new printed book, for those of you who are more cost sensitive (I do recommend the printed book in general though, as listings just don’t come through that well in the eBook editions).

As always, watch for corrections and updates here on advancedapex.com – as I’m quite sure Salesforce will continue to update the platform faster than I can revise the book 🙂

Salesforce and Apex Fundamentals for Developers

I’m pleased to announce the publication of my Pluralsight course “Salesforce and Apex Fundamentals for Developers” – the third update to my original Force.com and Apex Fundamentals for Developers course.

I know what you’re thinking – what has changed (aside from the obvious name change due to the diminishing use of Force.com)?

Most of changes relate to the part of the course that discusses development processes and methodologies. Which is a fancy way of saying: goodbye Force.com IDE – Hello SFDX.

Aside from SFDX, there is some new content – basically covering Apex and platform changes over the past couple of years.

This course is intended to guide software developers who have experience on other platforms to quickly transition to Salesforce Apex development. New developers should consider my other recent course “Salesforce Development: Getting Started

SFDX First – The Future of Learning and Teaching Salesforce

I recently published a new course on Pluralsight: “Salesforce Development: Getting Started” which is designed to be one’s very first introduction to Salesforce for developers and admins. It starts out in a way that most would find familiar: how to sign up for a developer org, an introduction to orgs and metadata – you know, the way everyone learns Salesforce.

But then I do something different. I talk about metadata, the source of truth, and Salesforce DX (SFDX). In fact, most of the course is about SFDX and how to use it. Not only that, but I’m very intentional about not focusing entirely on code. Automation and other metadata is given more or less equal time and emphasis. In fact, the alternate title for this course is “An Admin’s Guide to SFDX”.

You see, SFDX may draw on techniques familiar to software developers, but SFDX is not about managing software or code. SFDX is about managing metadata. All types of metadata.

SFDX is not about managing software or code – SFDX is about managing metadata

I truly believe it should be the among the first things every future Salesforce developer and admin learns – maybe the very first thing.

Ok, the developer part makes sense. But admins?

Yes. Hear me out.

(more…)

Security, Plumbing, and a Sneeze

Photo by Mila Sviderskaya

I had great fun writing my recent article “Objects, Relationships, and the Cat” in which I shared one of the things I enjoyed most about working on the Salesforce platform using a rather unconventional story-telling style. In fact, I enjoyed it so much, and based on the positive feedback from readers, I thought I’d do it again. As before, this is a work of fiction with the exception of the technical aspects.

I didn’t really notice that the conversation between my housemate and Angie had gotten louder. I was accustomed to their heated technical discussions. After all, spending several months mostly stuck indoors during a pandemic hadn’t exactly put us in a state of mind to be calm or quiet. Still, I probably wouldn’t have noticed them at all had they not suddenly become very quiet.

Their silence was probably a result of my earth-shattering sneeze. I pulled off my headphones, rubbed my nose, and stared at the cat gazing at me from the bookshelf beside my desk. She didn’t look the slightest bit guilty.

“You didn’t take your allergy medicine this morning, did you?” my housemate asked. I nodded. The pills are the price I pay for us having adopted a cat. I grabbed one and washed it down with some warm lemonade. 

“Okay,” I sniffled, knowing that I wouldn’t be able to concentrate for a while. “What are you two arguing about now?”

“My customer has a tough set of requirements with an impossible deadline and budget,” answered my housemate. “And we can’t agree on the best way to approach it. You’ve done enterprise software – care to give it a look?”

“Sure,” I replied. “It can’t be harder than living with the cat.” 

“It’s a corporate application,” he started, ignoring my comment. “Nothing special in terms of the database schema – a few related tables with some columns and a straightforward UI—just a few fields. Authentication is easy enough. They use single sign-on through a third party OAuth provider and their corporate users already have accounts. The kind of thing that any web framework can support easily.”

“That doesn’t seem too bad,” I said. “So, what’s the issue? And why did you call in Angie?”

(more…)

Objects, Relationships, and the Cat

People who know of my work in the Windows world sometimes ask me how I, a “real” programmer and former Microsoft MVP, could become so involved with Salesforce development. I thought I’d write a different kind of article highlighting one of the Salesforce platform features that I find compelling—and that makes Salesforce, for me, a serious platform for software development. Instead of the usual “dry” technical article, I present to you a story – a work of fiction (except for the technology, which is all true).

My housemate’s voice just barely infringed on my attention.  “They deleted a field!” he yelled. 

It wasn’t enough to distract me from my latest binge-watching effort.

“THEY DELETED A FIELD!”

The second  time I couldn’t ignore him. I turned around to find  quite a sight. He was on his feet shouting at the screen. Worse yet, he disturbed the cat, who decided I was the safest refuge. I reached for another allergy pill. Why we got a cat given my allergies, I have no idea.

“What’s going on?” I asked, trying to sound supportive. We’d both been working from home, sheltering in place for several months now, and I counted myself lucky—we still got along. Still, better him shouting at some remote miscreant than at me. “Who deleted what?”

He took a deep breath and explained. “Part of my client’s application went down yesterday, and they’ve been yelling at me to fix it,” he started. “It uses an Object Relationship Mapping library to make it easy to code against the database, and I was thinking it might have changed during a recent update. But it turns out that one of the client’s DBAs decided that a particular database column was no longer needed, and removed it.” He shook his head. “I just can’t believe it.”

Okay, I’m a nice guy, but I  couldn’t resist.“I can’t believe it either – it has to be something else. You can’t delete a column that’s in use.”

“Of course you can’t, that’s why it failed,” he explained.

“No, you can’t,” I said. “It’s not possible. If the column is in use, the database won’t let you delete it.”

Now he looked at me like I was crazy. Well, crazier–both of us were now three months without a haircut, so looking crazy was becoming the new normal.

“What do you mean the database won’t let you delete it?” he asked. “The database doesn’t care what you delete. It’s a database.”

I decided to be stubborn for just a bit longer. “You yourself said you were using an ORM library–so yes, the database should know the column is being used. After all, you’ve defined the objects and fields that map to the tables and columns–so the information is available. Right?”

(more…)