Skip to main content

Questions tagged [canonical-qa]

Use this tag to indicate that it is an umbrella question intended to answer a number of essentially duplicate questions that vary only in implementation detail. The question should be generic enough to cover the various details, and the answer should aim to be universally applicable to all would-be duplicates. This tag should not be used for "normal" questions.

Filter by
Sorted by
Tagged with
5 votes
1 answer
2k views

Why are my flow's input/output parameters not working with my InvocableMethod?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
sfdcfox's user avatar
  • 500k
11 votes
1 answer
2k views

How do I bulkify queries for directly or indirectly related records?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
5 votes
1 answer
2k views

Why can't I see related data in my Apex, or why are related records showing up as `null`?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
26 votes
2 answers
27k views

How do I get started working with JSON in Apex?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
12 votes
2 answers
3k views

What is a good pattern for recursion blocking in generic trigger handlers?

Here I'm talking about a handler that covers all the TriggerOperations and that accepts SObjects of arbitrary type. And the recursion problem is where a change caused by a trigger results in that ...
Keith C's user avatar
  • 137k
8 votes
1 answer
4k views

ApexMocks Troubleshooting Guide

Canonical Question and Answer When using ApexMocks, I'm getting unexpected results. What could be the possible reasons? Here are some of the symptoms I observe: Null pointer exception in my service ...
6 votes
2 answers
3k views

When should I use SeeAllData=true in my test methods?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
14 votes
1 answer
3k views

How do I unit test code that includes a callout?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
35 votes
1 answer
49k views

How do I increase my code coverage, or why can't I cover these lines?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
15 votes
1 answer
10k views

How do I test asynchronous Apex?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
23 votes
1 answer
6k views

How do I write an Apex unit test?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
18 votes
1 answer
3k views

How do I get lightning:datatable to do some undocumented thing X?

Canonical Question I want to do <some really cool thing> with a lightning:datatable, but I can't seem to figure out how to do it. I checked the documentation, but I did not see a way to ...
11 votes
1 answer
1k views

Working with SObjects instead of concrete custom objects (i.e., abstraction in apex)

We have a bunch of custom objects, some of which implement a specific set of custom fields of the same type. (e.g., UniqueID, ExternalID, etc.). I want to be able to write one method that takes and ...
Jorjani's user avatar
  • 2,232
3 votes
2 answers
9k views

How do I find the child relationship name?

I'm using a SOQL to query the lookup relationships. Primary Object: Opportunity Secondary Object: Purchase__c. From purchase__c we have a lookup to opportunity. Field Name: Opportunity__c Child ...
27 votes
6 answers
56k views

Where To start Learning With Salesforce Development

Where should I start learning? There are various topics to learn like Objects, Classes, Apex, Visualforce, SOSL, SOQL, Triggers, etc. There are so many options out there to start learning. I couldn't ...
21 votes
6 answers
47k views

How to write a unit-test / test class for trigger?

How do I write a unit-test / test class for a trigger? What are my options? Inline with the trigger? New Class?
71 votes
5 answers
37k views

How do you deserialize json properties that are reserved words in Apex?

Is there any way to deserialize JSON into an object using JSON.deserialize if some of the property names in the JSON are reserved words in Apex? I want to do something like this: string jsonString = '{...
Greg Grinberg's user avatar