Frequent Questions
12,097 questions
35
votes
1
answer
50k
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 ...
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 ...
26
votes
2
answers
29k
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 ...
110
votes
11
answers
43k
views
How do I start to debug my own Apex code?
Sometimes questions are posted here that would best be answered by helping the questioner learn how to do their own debugging. (Remember that proverb?) I'd like to have something to link to on this ...
158
votes
3
answers
27k
views
End of javascript sidebar workarounds? (Salesforce Classic / Aloha)
Reading through this doc:
Docs.releasenotes.salesforce
We replaced the rich text editor in HTML Area home page components
with a new version that supports more markup but doesn’t allow HTML to
...
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 ...
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?
50
votes
3
answers
14k
views
General trigger bulkification - best practices
A general question asked from time to time on stack exchange is question of trigger bulkification.
Therefore I have 2 questions:
Which best practices are you using?
What is the best way to handle ...
169
votes
4
answers
72k
views
What are Salesforce ID's composed of?
I remember seeing somewhere that IDs are composed of a few pieces. I always have a hard time trying to find that information when I'm looking for it. What I mean by the above is that the various ...
53
votes
1
answer
29k
views
How do I start to debug my own Visualforce/JavaScript?
This question is intended to complement How do I start to debug my own Apex code? as sometimes questions are asked here that could most easily sorted out by the questioner using their browser's "...
19
votes
1
answer
95k
views
How to deserialize a JSON String to Apex
How can I deserialize this json object:
{
"response": {
"count": 1,
"benchmark": 0.22567009925842,
"requests": [
{
"request": {
...
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 ...
15
votes
4
answers
8k
views
System.Exception: Too many SOQL queries: 101 [duplicate]
I am getting a Too many SOQL queries: 101 error on a trigger when I am trying to deploy another trigger.
I am posting the trigger which is causing the error.
trigger rollupAccountShowings on Account ...
72
votes
8
answers
73k
views
Get lists of dependent picklist options in Apex
I have a pair of dependent picklists. In Apex code, how can I determine what options are valid in the dependent field for each option in the controlling field?
I've tried using getPicklistValues(), ...
5
votes
4
answers
31k
views
Changing colors of lightning-button
How can I change the colors of lightning-button?
I tried doing this in my css:
.my-button {
background-color: #14a6bc;
color: #ffffff;
}
and applying that class to my <lightning-button>...