Most Popular

1500 questions
86
votes
2 answers

Salesforce, Oracle and the Seven Dwarfs

Over my time as a Salesforce developer, I've written some code which on occasion managed to surface Oracle plsql exceptions and curiously the error text contains the name of one of Disney's Seven Dwarfs. I've teased out Doc, Grumpy, Happy, Bashful…
Mark Pond
  • 22,949
  • 2
  • 56
  • 103
83
votes
5 answers

Pokemon Catch - Generic Exception Handling In Apex

I read a great post about this topic on Stack Overflow: Is it really that bad to catch a general exception? However, I asked this question on our exchange because I am interested in a more specific discussion of how this topic fits in with a…
Adrian Larson
  • 149,971
  • 38
  • 239
  • 420
82
votes
3 answers

How does SF calculate the CPU time?

How does SalesForce calculate the CPU Time that was introduced in Winter '14? I am seeing varying results from it. Why does the CPU count vary? I am running a single block of code over and over again in an org with all triggers disabled. There's…
BarCotter
  • 12,331
  • 4
  • 37
  • 58
82
votes
2 answers

Has anyone, ever, successfully invoked the Metadata API from within Apex?

While researching a semi-related question posted here earlier, I dug up some interesting and conflicting information regarding whether it's even possible to use the Metadata API from within Apex. I used to be of the belief that this was strictly…
Adam
  • 4,348
  • 1
  • 26
  • 28
78
votes
11 answers

How to study/prepare for the Salesforce Developer Certification

I am fairly new to Force.com development (less than a year). I did not learn it from the ground up. So I think it will be good to study for the developer exam to strengthen my basics and improve my overall knowledge of Force.com + it will be great…
Richard N
  • 3,812
  • 5
  • 36
  • 54
77
votes
3 answers

What is the difference between Custom Settings and Custom Metadata Types

Summer '15 is going to include the GA release of Custom Metadata Types. See Introducing custom metadata types: the app configuration engine for Force.com Are Custom Metadata Types intended as a complete replacement for Custom Settings? I gather from…
Daniel Ballinger
  • 102,288
  • 39
  • 270
  • 594
75
votes
1 answer

InstallHandler runs under a special ghost user. What rights does it have?

When you install a managed package with a post-install script, Salesforce creates a special ghost user under which all of the post install activities occur. I think this is undocumented. Here are some details. This can be great from an audit point…
Matt and Neil
  • 32,894
  • 7
  • 105
  • 186
74
votes
4 answers

Elegant way to convert Set into String for Dynamic SOQL IN comparison

When I have a Set of Id's and I want to do a dynamic SOQL query that I want to use it in for an IN comparison, I have to convert the Set to string in the format of: ('id1','id2',id3',...) The way I do it works, but is not particularly elegant, so…
pchittum
  • 19,701
  • 5
  • 54
  • 97
73
votes
6 answers

What is a good set of naming conventions to use when developing on the Force.com platform?

I've looked in the Apex developer's guide and a saw the Naming Conventions section which has basically only has this: We recommend following Java standards for naming, that is, classes start with a capital letter, methods start with a lowercase…
Peter Knolle
  • 29,077
  • 12
  • 99
  • 162
72
votes
8 answers

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(), but there doesn't seem to be any way of getting…
Benj
  • 11,197
  • 8
  • 66
  • 121
71
votes
2 answers

Connected App - avoiding a limit on a number of issued tokens + token expiration

We have configured our web application to use OAuth2 with our SFDC Connected App. The connected app is configured to never expire the refresh token unless manually revoked. When an admin connects the Connected App to our web application it stores…
Vyrotek
  • 1,365
  • 1
  • 9
  • 16
70
votes
5 answers

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 = '{"currency" : "ABC"}'; public class JSONResult { …
Greg Grinberg
  • 7,471
  • 1
  • 39
  • 71
70
votes
8 answers

What is the best way to deploy profiles in Salesforce? (especially system admin)

What is the best way to deploy profiles in Salesforce? I have a system admin profile with access given to the objects that i have created in my sandbox. I have about 1000 fields across these objects. Eclipse suggests that we should not deploy…
Sathya
  • 3,202
  • 6
  • 36
  • 48
66
votes
8 answers

Removing old hub org, or non-scratch org from Salesforce DX org list

In the Salesforce DX pilot, every pilot participant was given a temporary dev hub org. These orgs expired, were destroyed, and sent back to the matrix in advance of the open beta. I had an existing installation of the Salesforce DX cli, and I found…
pchittum
  • 19,701
  • 5
  • 54
  • 97
65
votes
1 answer

Is there a way to do Like against a list of Values?

Is there a way to mix LIKE operator with IN ? Something Like SELECT Id FROM Account WHERE Name LIKE IN:nameList Where nameList is list of String? Is this is possible ? (I can make a dynamic query by doing OR with all the elements, but was looking…
Avidev9
  • 5,649
  • 4
  • 36
  • 50