Most Popular

1500 questions
167
votes
4 answers

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 places in the ID represent different things - for…
Ryan Elkins
  • 7,677
  • 10
  • 48
  • 77
160
votes
8 answers

Unit testing code which has logic around the CreatedDate

An example of the problem would be trying to test a trigger on a case which will fire on update, and look for time differences between when a case was created and now. Ideally in the unit tests I want to create a case with a CreatedDate in the past.…
David Gillen
  • 2,997
  • 3
  • 19
  • 26
158
votes
3 answers

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 be manually entered. In Summer ’15 we will start…
Rao
  • 16,691
  • 13
  • 68
  • 108
140
votes
2 answers

Any reason to skip DML on empty lists?

In parts of my code I have DML statements with an if around to only do the DML if the list is not empty: if( !recordsToUpdate.isEmpty() ) { update recordsToUpdate; } Couldn't I just write? update recordsToUpdate; Or would I provoke errors or…
Robert Sösemann
  • 37,622
  • 26
  • 165
  • 495
134
votes
3 answers

Force.com IDE - Still Officially Supported?

In the Summer '13 release webinar, Ryan Upton and Samantha Ready mention that the Force.com IDE is no longer being supported. During the Q&A time, they both chime in on a question related to the IDE. The question starts at 53:30 and runs to…
Jesse Altman
  • 19,718
  • 10
  • 58
  • 103
128
votes
2 answers

How to reduce a large internal view state / what is in the internal view state?

I'm building an account search page that lets users select accounts and then pass them to other pages to perform various actions on them. Unfortunately users are reporting hitting the view state limit. Which leads me to a broader question: what is…
Ralph Callaway
  • 24,529
  • 17
  • 112
  • 190
126
votes
2 answers

Is it possible to run a SOQL Query and get a Map returned?

It is possible to run query and the results inserted into an Apex list: List opportunities = [SELECT Opportunity.OwnerId, Opportunity.Probability, …
dublintech
  • 4,253
  • 10
  • 40
  • 56
125
votes
3 answers

How can I efficiently generate a Set from a List structure?

I have a bit of code where I've written a SOQL query that returns a list of SObject records, however I need a Set structure to pass to another method that I don't have control of (and thus can't change the method signature of). How can I turn my…
ca_peterson
  • 22,983
  • 7
  • 69
  • 123
118
votes
1 answer

Difference between the multiple messaging options in Visualforce?

I have always been curious what are the exact differences between all of the messaging options Visualforce provides, such as apex:message, apex:messages, apex:pageMessage, and apex:pageMessages. The description the Salesforce documentation at times…
Jesse Altman
  • 19,718
  • 10
  • 58
  • 103
117
votes
14 answers

Can we determine if the Salesforce instance is production org or a Sandbox org?

I am looking for the most efficient way of identifying the type of org (Production or Sandbox) via Apex code. URL scraping is not useful to me, since I'd like to get this information inside a trigger where URLs don't make sense. Thanks!
Anup
  • 3,810
  • 6
  • 26
  • 41
109
votes
11 answers

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 site for that purpose. So please provide a step by…
Keith C
  • 135,775
  • 26
  • 201
  • 437
103
votes
1 answer

When are the Queueable/Batchable penalties going to be enforced?

According to The New Apex Queueable Interface, from October 2014, we were told that chained Queueable calls would be exponentially delayed up to 64 seconds, chaining Batches would be exponentially delayed up to 240 seconds (four minutes), and…
sfdcfox
  • 489,769
  • 21
  • 458
  • 806
90
votes
7 answers

Apex static code analysis

What static code analysis tools are there for apex? The only one I seem to be able to find is the Force.com Security Source Code Scanner but that has the draw back of placing your request into a queue and running it when it can. I would like…
Bob Roberts
  • 2,785
  • 1
  • 25
  • 29
87
votes
4 answers

SFDC: Understanding With Sharing, Without Sharing & Unspecified Sharing Classes

Per my understanding of With Sharing, Without Sharing and non-sharing-specified Classes in Apex, I would like to jot down the following notes and leave certain blanks for not sure answers; I wanted to know if I were correct/not and clear/not with…
Swati
  • 871
  • 1
  • 7
  • 3
86
votes
7 answers

How to study/prepare for the Salesforce ADVANCED Developer Certification?

After reading the overwhelming responses to the question How to study/prepare for the Salesforce Developer Certification, I decided to ask the same question but for the Advanced Developer Certification! I have more than one year of experience as a…
Shumon Saha
  • 4,632
  • 12
  • 49
  • 81
1
2 3
99 100