All Questions

Filter by
Sorted by
Tagged with
151
votes
3answers
24k 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 ...
136
votes
4answers
33k 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 ...
133
votes
8answers
20k views

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 ...
128
votes
3answers
8k views

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 ...
122
votes
2answers
24k views

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 ...
115
votes
1answer
17k views

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 ...
101
votes
11answers
30k 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 ...
99
votes
3answers
59k views

How can I efficiently generate a Set<Id> from a List<SObject> 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<Id> structure to pass to another method that I don't have control of (and thus ...
96
votes
2answers
74k views

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<Opportunity> opportunities = [SELECT Opportunity.OwnerId, Opportunity....
92
votes
3answers
4k views

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? ...
91
votes
0answers
2k views

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 ...
90
votes
8answers
22k views

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 ...
83
votes
7answers
16k views

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 ...
80
votes
2answers
13k views

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 ...
80
votes
3answers
11k views

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 ...
76
votes
7answers
12k views

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 ...
76
votes
11answers
74k views

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 ...
71
votes
4answers
23k views

Elegant way to convert Set<Id> 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 ...
67
votes
3answers
18k views

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 ...
66
votes
5answers
9k views

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 ...
64
votes
6answers
17k views

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 ...
64
votes
4answers
36k views

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 ...
60
votes
2answers
22k views

What causes a Connected App's Refresh Token to expire?

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 ...
59
votes
8answers
38k 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(), ...
59
votes
8answers
45k views

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. ...
58
votes
1answer
3k views

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 ...
57
votes
3answers
19k views

What is the difference between Aura and Lightning frameworks?

Apart from Wave, the biggest announcement from a developer perspective at Dreamforce 2014 is "Lightning" and it will be announced in the big keynote by Marc Benioff today. I've started to play around ...
56
votes
2answers
5k views

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 ...
54
votes
5answers
7k views

How can I get 'Recent Items' object Ids in Apex (soql) is it possible

'Recent Items' pane shows recently viewed records for the selected tab. The list is derived from your recent items and includes records owned by you and other users. Is there any way to get this in ...
54
votes
4answers
15k views

Call Apex class method on the fly (dynamically)

Is there any way I can call apex method from class if both class name and method are stored in the string. String strClass = 'BatchUtil'; String strMethod = 'updateAccounts' now I want to call above ...
53
votes
10answers
65k views

What would be the best approach to get the recordtype id

I know of two approaches to get the recordtype id of a particular record type Use SOQL RecordType RecType = [Select Id From RecordType Where SobjectType = 'Account' and DeveloperName = 'Business'];...
53
votes
1answer
13k views

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 ...
53
votes
6answers
25k views

Can report data be accessed programatically?

Is there any way to access existing reports and their data to be used in apex? Sure, I could write the SOQL manually but if I want it to mirror a specific report I would have to make code changes ...
53
votes
1answer
779 views

How does Salesforce determine where to apply the “*** Skipped X bytes of detailed log” section in a log

Firstly, this question isn't about how to access missing log content when a *** Skipped 53353122 bytes of detailed log style message is encountered. That is covered in another question and resolves ...
52
votes
4answers
3k views

Apex debugging in Winter '16 - how well does it work?

This Debug Apex Code in Eclipse (Generally Available) release note says: The Apex Debugger extends the Force.com IDE plug-in for Eclipse and behaves similarly to debuggers available for other ...
52
votes
2answers
46k views

Apex List For Loops 101

I just have a simple question about how list for loops work that has been bugging me. Does the for loop variable refer to the actual list item? Here's what I mean: Say I have a list of accounts. ...
52
votes
3answers
4k views

Should we use process builder at all?

Forgive me if this isn’t an appropriate topic for this board but I would like to have an open and honest discussion about Process Builder. We have a multi-tenant org (different business units using ...
51
votes
5answers
24k views

What is Salesforce1 and why/when would I use it?

I've seen a lot of mentions of Salesforce1 coming out of Dreamforce this year. As a developer, what is it and why(or when) would I want to use it? I get the impression it is a refinement of the ...
51
votes
2answers
17k views

Lead Conversion Trigger Order of Execution

I've got a project where I'm looking to tweak the standard lead conversion process. Triggers and lead conversion has always been funky in past projects so I was hoping to start the design off by ...
50
votes
3answers
21k views

What's the practical difference between canvas & connected apps?

Question What's the point of canvas vs. connected apps, and what should I be thinking about when choosing between them? Background We're in the process of building out a couple tools that will be ...
50
votes
5answers
55k views

How to run a scheduled job every 15 minutes?

Using the salesforce GUI it seams impossible to schedule a job every 15 minutes. Or more than once a day.
49
votes
5answers
16k 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 = '...
49
votes
1answer
16k 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 "...
48
votes
3answers
11k 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 ...
48
votes
3answers
20k views

Why use Batch Apex?

What is the point of batch apex? I've been trying to do some research but everything I find just tells me how to use it or goes over scenarios where it might be useful - without telling me why I would ...
48
votes
4answers
1k views

How can we get “Developer” bugs logged with Technical Support?

I recently found a bug, which I mentioned on The Force.com Discussion Boards, as well as submitting a case, and after a few days fumbling around with the case, they closed it by saying that they only ...
48
votes
2answers
32k views

What are the available $A JavaScript functions in Lightning?

The Lightning Components Cheat Sheet lists a few common $A functions and the Lightning Components Developer Guide references some others that are useful for certain situations. I can view the $A ...
48
votes
1answer
36k views

Setting a from address in SingleEmailMessage

I want to set a from address in a salesforce SingleEmailMessage, but can't see a way to do this and there is no standard method described in the documentation. I want the email to be sent from ...
47
votes
5answers
12k views

How to call a Salesforce REST URL from Lightning Component?

I want to call a Salesforce REST URL from a Lightning Component. Specifically, I'm trying to call this Analytics API URL: /services/data/v32.0/analytics/reports. I see the following error in the ...
46
votes
6answers
25k views

How can I get a debug log for the sites guest user/public profile? [updated for Spring 18]

Normally, you can put debug monitoring on a user by name to see the details on the error they're getting (especially for the non-descript Error Loading a Visualforce Page). But when you are trying to ...

15 30 50 per page