All Questions

Filter by
Sorted by
Tagged with
163 votes
4 answers
52k 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 ...
user avatar
  • 7,537
158 votes
3 answers
26k 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 ...
user avatar
  • 16.5k
151 votes
8 answers
32k 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 ...
user avatar
  • 2,897
133 votes
3 answers
9k 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 ...
user avatar
  • 19.5k
130 votes
2 answers
9k 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? ...
user avatar
127 votes
2 answers
26k 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 ...
user avatar
117 votes
2 answers
118k 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....
user avatar
  • 4,063
117 votes
1 answer
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 ...
user avatar
  • 19.5k
116 votes
3 answers
99k 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 ...
user avatar
  • 22.2k
108 votes
10 answers
39k 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 ...
user avatar
  • 130k
106 votes
9 answers
42k 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 ...
user avatar
  • 3,661
101 votes
1 answer
3k 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 ...
user avatar
  • 433k
87 votes
7 answers
14k 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 ...
user avatar
  • 2,725
85 votes
7 answers
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 ...
user avatar
  • 4,532
83 votes
4 answers
49k 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 ...
user avatar
  • 831
81 votes
2 answers
16k 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 ...
user avatar
  • 4,248
81 votes
3 answers
13k 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 ...
user avatar
  • 12.1k
80 votes
5 answers
11k 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 ...
user avatar
  • 143k
79 votes
2 answers
11k 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 ...
user avatar
  • 22.3k
77 votes
11 answers
75k 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 ...
75 votes
3 answers
35k 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 ...
user avatar
71 votes
4 answers
27k 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 ...
user avatar
  • 19.1k
70 votes
6 answers
24k 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 ...
user avatar
  • 28.7k
69 votes
1 answer
5k 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 ...
user avatar
67 votes
8 answers
56k 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(), ...
user avatar
  • 10.9k
67 votes
2 answers
32k views

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 ...
user avatar
  • 1,325
65 votes
8 answers
67k 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. ...
user avatar
  • 3,102
63 votes
5 answers
29k 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 = '...
user avatar
63 votes
4 answers
25k 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 ...
user avatar
63 votes
1 answer
51k 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 ...
user avatar
  • 1,076
61 votes
10 answers
83k 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'];...
user avatar
  • 11.9k
61 votes
1 answer
20k 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 ...
user avatar
  • 5,529
59 votes
6 answers
80k 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.
user avatar
59 votes
3 answers
26k 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 ...
user avatar
58 votes
3 answers
25k 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 ...
user avatar
58 votes
3 answers
22k 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 ...
user avatar
57 votes
5 answers
8k 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 ...
user avatar
57 votes
2 answers
58k 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. ...
user avatar
  • 1,667
57 votes
1 answer
987 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 revolves ...
user avatar
56 votes
6 answers
30k 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 ...
user avatar
  • 7,537
55 votes
6 answers
45k views

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 ...
user avatar
  • 19.1k
55 votes
1 answer
100k views

Using sObject.get() to fetch a field value from a related parent object

I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using sObject.get('MyContactField__c') I'm not able to get fields off the related parent object, ...
user avatar
  • 14.5k
55 votes
3 answers
5k 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 ...
user avatar
  • 1,551
53 votes
8 answers
58k views

How Can I Tell the Day of the Week of a Date?

I'd like to build in some logic based on the weekday (e.g. Monday, Tuesday, Wednesday) of a given date. How can I identify the date, using either formulas or Apex code?
user avatar
  • 10.9k
53 votes
7 answers
33k 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 ...
user avatar
53 votes
6 answers
45k views

Deleting Triggers/Classes from Production

I was recently told ( Deleting a Class with IDE - cannot delete from Production? ): You cannot delete a class in production directly. You will need delete the class from your sandbox and then ...
user avatar
  • 4,584
53 votes
4 answers
4k 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 ...
user avatar
  • 130k
52 votes
5 answers
26k 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 ...
user avatar
52 votes
1 answer
22k 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 "...
user avatar
  • 130k
51 votes
8 answers
28k views

Target inner elements of standard Lightning Web Components with CSS

Say we have a LWC with the following template in a component named example: <template> <lightning-textarea class="test"></lightning-textarea> </template> And some css to ...
user avatar

15 30 50 per page
1
2 3 4 5
2471