All Questions

Filter by
Sorted by
Tagged with
166 votes
4 answers
64k 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 ...
Ryan Elkins's user avatar
  • 7,637
158 votes
8 answers
37k 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 ...
David Gillen's user avatar
  • 2,977
157 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 ...
Rao's user avatar
  • 16.7k
138 votes
2 answers
11k 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? ...
Robert Sösemann's user avatar
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 ...
Jesse Altman's user avatar
  • 19.7k
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 ...
Ralph Callaway's user avatar
125 votes
2 answers
152k 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....
dublintech's user avatar
  • 4,223
124 votes
3 answers
122k 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 ...
ca_peterson's user avatar
  • 22.9k
117 votes
1 answer
18k 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 ...
Jesse Altman's user avatar
  • 19.7k
115 votes
13 answers
54k 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 ...
Anup's user avatar
  • 3,790
109 votes
11 answers
41k 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 ...
Keith C's user avatar
  • 135k
102 votes
1 answer
4k 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 ...
sfdcfox's user avatar
  • 481k
88 votes
7 answers
15k 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 ...
Bob Roberts's user avatar
  • 2,755
86 votes
4 answers
53k 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 ...
Swati's user avatar
  • 861
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 ...
Shumon Saha's user avatar
  • 4,592
84 votes
2 answers
15k 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 ...
Mark Pond's user avatar
  • 22.9k
82 votes
5 answers
12k 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 ...
Adrian Larson's user avatar
  • 149k
81 votes
2 answers
17k 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 ...
Adam's user avatar
  • 4,328
81 votes
3 answers
14k 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 ...
BarCotter's user avatar
  • 12.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 ...
76 votes
3 answers
37k 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 ...
Daniel Ballinger's user avatar
74 votes
1 answer
6k 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 ...
Matt and Neil's user avatar
73 votes
4 answers
28k 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 ...
pchittum's user avatar
  • 19.6k
72 votes
6 answers
25k 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 ...
Peter Knolle's user avatar
71 votes
8 answers
65k 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(), ...
Benj's user avatar
  • 11.2k
70 votes
2 answers
38k 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 ...
Vyrotek's user avatar
  • 1,355
69 votes
8 answers
76k 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. ...
Sathya's user avatar
  • 3,192
68 votes
5 answers
35k 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 = '{...
Greg Grinberg's user avatar
64 votes
1 answer
24k 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 ...
Avidev9's user avatar
  • 5,609
64 votes
4 answers
29k 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 ...
Prafulla Patil's user avatar
64 votes
1 answer
60k 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 ...
c14kaa's user avatar
  • 1,086
63 votes
8 answers
74k 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 ...
pchittum's user avatar
  • 19.6k
62 votes
10 answers
85k 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'];...
Prady's user avatar
  • 12.2k
61 votes
6 answers
93k 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.
Christian Deckert's user avatar
60 votes
3 answers
26k 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 ...
Ralph Callaway's user avatar
60 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 ...
Gaurav Kheterpal's user avatar
60 votes
3 answers
30k 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 ...
Ralph Callaway's user avatar
59 votes
1 answer
114k 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, ...
greenstork's user avatar
  • 14.7k
58 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 ...
Prafulla Patil's user avatar
58 votes
2 answers
64k 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. ...
Aaron P.'s user avatar
  • 1,667
57 votes
7 answers
38k 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 ...
Shane McLaughlin's user avatar
57 votes
6 answers
31k 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 ...
Ryan Elkins's user avatar
  • 7,637
57 votes
1 answer
1k 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 ...
Daniel Ballinger's user avatar
56 votes
6 answers
47k 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 ...
AMM's user avatar
  • 4,674
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 ...
Stephen's user avatar
  • 1,551
54 votes
8 answers
73k 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?
Benj's user avatar
  • 11.2k
54 votes
1 answer
16k views

What are the object and field name suffixes that Salesforce uses? Such as __c and __x

When working with API names for objects and fields they will often have suffixes such as __c and __x. What suffixes are there and what do these API name suffixes indicate?
Daniel Ballinger's user avatar
53 votes
8 answers
36k 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 ...
Benjamin Vogler's user avatar
53 votes
3 answers
11k views

Where are all past Salesforce Release Notes

As a follow on to the recently posted question "What are all of the reasons why Salesforce customers should upgrade the API version on their Apex classes, triggers, and pages?". Where can I find all ...
Alan Morey's user avatar
  • 2,421
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 ...
Keith C's user avatar
  • 135k

15 30 50 per page
1
2 3 4 5
2655