Skip to main content
14 votes
Accepted

Schedule and Run a Report as an specific User from Apex

I want to sketch out a possible design, as this is a question I've been turning over myself. For the record, I have not had time to build this out myself, even as a proof of concept, but I think ...
David Reed's user avatar
  • 93.4k
11 votes

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

I haven't done much lightning development outside of a handful "hello world" apps, but I've been building React/Typescript/Visualforce apps on salesforce for several years and I'm confident that non-...
NSjonas's user avatar
  • 10.2k
10 votes

Any Platform Event Library or Best Practices out there?

Is it smart to create events like CaseInserted__e for all the possible objects i need to track, or is is smarter to have a general SObjectInserted__e event? Generally, use one event for each unique ...
sfdcfox's user avatar
  • 500k
10 votes
Accepted

Service methods in Lightning Components

Realistically, you'll probably want to create a Static Resource, and use this as a shared resource, also outlined in Modularizing Code in Lightning Components. In your JavaScript file, you'll want to ...
sfdcfox's user avatar
  • 500k
10 votes

Dealing with auto-batching of triggers

However, this 1) doesn't work for before insert since the id doesn't yet exist, and 2) feels legitmately hacky. Are there any better ways to do this? Your approach (Set<Id> recordsProcessed) is ...
Adrian Larson's user avatar
  • 151k
10 votes
Accepted

lwc dataservice architecture best practices

Firstly, a very nicely framed question! Here is what we found to be best after brain-storming: Apex methods should be used ONLY for getting the data and for DML statements. In short, it should be ...
salesforce-sas's user avatar
9 votes
Accepted

One Process Builder vs Multiple per single Object

If you have a great many processes you want to automate, then consolidating them into one flow via Process Builder can be a great choice from an organization perspective. Doing so will also give you ...
Adrian Larson's user avatar
  • 151k
8 votes
Accepted

Inner Classes/Interfaces

It means that an inner class can't have an inner class in Apex. So a structure like this is legal and common, especially when implementing patterns like wrapper classes or dependency injection: ...
David Reed's user avatar
  • 93.4k
8 votes
Accepted

Does Lookup Skew affect only master-detail relationships or also lookup ones?

Skew and lock contention are generally two different issues. About skew In a nutshell, skew is a matter of probability distribution. A good database index is one that has a uniform-ish distribution. ...
Derek F's user avatar
  • 63.2k
7 votes

Salesforce Marketing Cloud Architecture

Most of the details are outlined in the Marketing Cloud Connect documentation. When most people get into the guts of the connector, they realize that it's not as simple or as straightforward as ...
Adam Spriggs's user avatar
  • 30.9k
7 votes

Skinny Tables - Salesforce

It makes sense to store this info in separate tables. There's only handful of standard fields and almost all of them are indexed. It's a good idea to have them in a table that doesn't change very ...
eyescream's user avatar
  • 24.1k
7 votes
Accepted

Sandboxes - Full versus Partial Copy - Same Except Storage

There are more differences. A Full Sandbox can only be refreshed every 29 days, whereas a Partial Copy Sandbox can be refreshed every 5 days. Only sample data is copied to a Partial Copy Sandbox on ...
Adrian Larson's user avatar
  • 151k
7 votes
Accepted

Salesforce and microservices

In Salesforce the equivalent of a database is an org and Salesforce charge per User per month per org. So a custom object per org would get very expensive very quickly... From the link in your ...
Keith C's user avatar
  • 137k
7 votes

Enterprise Layers and Naming Conventions

Here is what I use (I follow the fflib apex-common examples pattern plus the examples in the Fawcett book which are about custom objects Driver__c, Contestant__c, and Race__c). Standard object like ...
cropredy's user avatar
  • 72.5k
6 votes

What's the practical difference between canvas & connected apps?

I want to explain this in a different way. Some of the difference between the two is lying within the settings for canvas app as below. As soon as you click that little checkbox called 'Canvas' within ...
Sharad Mittal's user avatar
6 votes

Separation of Concerns?

Yes it should be considered with every single method you write. Each line of code—or if you want to go deeper than that, each cyclomatic branching within your code—is vulnerable to trying to do more ...
Adrian Larson's user avatar
  • 151k
6 votes
Accepted

How to get a runtime list of all fields of a given sObject?

If you know the SObjectType already: public static List<SObjectField> getFields(SObjectType sObjectType) { return sObjectType.getDescribe().fields.getMap().values(); } If you just have an ...
Adrian Larson's user avatar
  • 151k
6 votes

Service methods in Lightning Components

In Winter 18, you can create a utility class and use it to directly return results without using a callback. Quote: We made it easier to return a result from aura:method, which is used to ...
Caspar Harmer's user avatar
6 votes

Lightning Framework vs Standard Client Side Frameworks (i.e. React) // Which to chose when, and why?

To begin with I would approach your question different way rather than In what cases are lightning components the right choice? I would ask my self In what cases are lightning components not the ...
Hemavantha Rajesh Varma Mudunu's user avatar
6 votes

Why the Service layer is usually implemented with Static methods?

I've gone in to a lot of detail about static and instance methods. Generally speaking, a method like the one written in the Trailhead falls under the category of a "utility method." A ...
sfdcfox's user avatar
  • 500k
6 votes
Accepted

Salesforce file storage off loading to AWS S3 to save file storage space in Salesforce

Has anyone faced a similar challenge? Sure. Salesforce storage has always been known to be relatively expensive compared to mass storage services like Google and Amazon, so using a cost-effective ...
sfdcfox's user avatar
  • 500k
5 votes

Any Platform Event Library or Best Practices out there?

This post contains multiple questions and is probably too broad but let me try to answer anyway. Overall I would say that using Platform Events (PEs) instead of triggers is not a good approach if you ...
POZ's user avatar
  • 4,449
5 votes

Dealing with auto-batching of triggers

My first question: what is the best practice to handle a trigger firstRun variable? Since workflows can often cause a trigger to run twice, it's important to pass through pieces of logic only the ...
crmprogdev's user avatar
4 votes
Accepted

Useful books to master Salesforce

I own the first and last book and I can say they are completely worth it! I learn a lot thanks to them and improved a lot my coding skills and overall knowledge of the salesforce platform. I would ...
Alexander Aeons Torn's user avatar
4 votes

Understanding the execution

TL;DR version: Salesforce has put a lot of thought into when things are executed. Without input from an authoritative source inside of Salesforce, the best we can do is guess. This is one of those ...
Derek F's user avatar
  • 63.2k
4 votes

Split Account fields across multiple Visualforce Tabs....Possible?...Been-There-Done-That?

One way you can do it is to use FieldSets. You create a field set for each tab and inside the override page, use a repeat to render them. Like so: <apex:repeat value="{!$ObjectType.Account....
Caspar Harmer's user avatar
4 votes
Accepted

Design Question: Any way around the "System.AsyncException: Future method cannot be called from a future or batch method" error in this situation?

I normally check three things before firing a @future method. Note, I learned a lot from reading Advanced Apex Programming by Dan Appleman. The asynchronous patterns are probably his strongest work. ...
Adrian Larson's user avatar
  • 151k
4 votes

Enterprise Layers and Naming Conventions

Note that I am not a user of https://github.com/financialforcedev/fflib-apex-common so this is an outsider's opinion. If you want to include pattern names in class names then making the pattern name ...
Keith C's user avatar
  • 137k
4 votes

Is it possible to check the time taken by a Salesforce Record to load when we we view/open the record?

If you're on lightning, there's some documented steps you can take: https://trailhead.salesforce.com/en/content/learn/modules/lightning-experience-performance-optimization/measure-lightning-experience-...
Kris Goncalves's user avatar
4 votes
Accepted

Why the Service layer is usually implemented with Static methods?

In addition to @sfdcfox answer, let me throw in how the fflib pattern supports dependency injection for services during unit testing Here's a Contact Service public inherited sharing class ...
cropredy's user avatar
  • 72.5k

Only top scored, non community-wiki answers of a minimum length are eligible