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
7
votes
1answer
175 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 ...
3
votes
1answer
77 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 ...
14
votes
2answers
1k 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 ...
10
votes
2answers
405 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 ...
6
votes
1answer
854 views

My ApexMocks aren't working - what could be wrong?

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 ...
5
votes
1answer
809 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 ...
13
votes
1answer
1k 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 ...
24
votes
1answer
7k 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 ...
13
votes
1answer
2k 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 ...
19
votes
1answer
2k 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 ...
14
votes
1answer
2k 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 ...
1
vote
2answers
2k 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
6answers
55k 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 ...
19
votes
6answers
36k 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?