All Questions

Filter by
Sorted by
Tagged with
46
votes
1answer
4k views

Winter 16 recalculateFormulas() fails when sObject has relationship fields

Using the new method on sObject recalculateFormulas() fails when the Sobject includes relationship fields - note account.name in the query. FATAL_ERROR System.UnexpectedException: Opportunity: bad ...
45
votes
2answers
9k views

Changing the color of a custom button

Is there a way of changing a custom button color? Not a button on the visualforce page but rather the ones created under custom and links on an object. Thanks. -K
45
votes
3answers
7k views

Salesforce bug enabled “Modify All”

Apparently, Salesforce has released a patch that implicated "Modify all" to be enabled for every single profile in some orgs. This includes standard profiles and custom as well. Yes, even standard ...
45
votes
12answers
30k views

Copy Production data to Developer Sandbox

I'm on Enterprise Edition and only have a developer sandbox... (I really miss my Full Copy sandbox and UE). I need to do some tests against "real" data. I have a strict rule of not testing or ...
45
votes
4answers
28k views

Can I get my security token without having to reset it?

I need to get a user's security token but there are other things currently using it so I don't really want to reset it. Is there any way to retrieve this without having to reset it?
44
votes
4answers
14k views

Workflow rule causing trigger to fire twice

I need to be able to detect that the trigger execution is happening because of a workflow field update. There is a suggestion in the cookbook: Controlling Recursive Triggers But this solution is not ...
43
votes
7answers
30k 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?
43
votes
5answers
2k views

What are all of the reasons why Salesforce customers should upgrade the API version on their Apex classes, triggers, and pages?

I haven't been able to find any official documentation or community discussion of the compelling reasons to upgrade the API version on Apex classes, triggers, and pages. I know there is the general ...
43
votes
4answers
32k 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 ...
43
votes
2answers
6k views

Lightning Experience: How to prevent the display of obsolete data?

In many cases I've seen that LE is not displaying recent changes made in Setup immediately like in Salesforce Classic, but somehow cached or delayed. Yesterday I found an easy and perfectly ...
42
votes
6answers
26k views

How can I tell which release my org is running?

Usually you can tell what release (e.g. Winter '14) you are running under by looking at the logo in the top left, but if that has been customized or removed it's not an option. Is there some place in ...
42
votes
3answers
41k views

ISBLANK vs ISNULL

I am just wondering what could be differences between ISBLANK and ISNULL. I found following link http://shivasoft.in/blog/salesforce/salesforce-interview-questions-%E2%80%93-part-2/ But I think ...
42
votes
2answers
5k views

Inheriting non-implicit constructors on Apex classes

If I have an abstract parent class like this: abstract class Vehicle { public Vehicle(Person driver) { // } } and then I create a child class like this: public class MagicCarpet ...
42
votes
4answers
13k views

SOQL Record Locking : For Update

Well I was trying to Implement Record Locking apex but Salesforce Document doesn't seem to help much. Even tried searching stackexchange there was a old question but the answer form StackExchange and ...
42
votes
1answer
745 views

Why is the Salesforce developer documentation NOT indexed on Google anymore?

For years now I'm working frequently with some Salesforce developer documentations, e.g.: Apex Developer Guide Visualforce Developer Guide The best and easiest way in my workflow to find stuff (in ...
41
votes
4answers
1k views

Why Are Data Silos Important in Unit Tests?

I have a lot of strong opinions about this issue, but had a hard time finding official documents today to back up my position. A lot of times we say it is bad practice to use seeAllData=true, but we ...
41
votes
3answers
5k 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 ...
41
votes
3answers
19k views

Scheduled reports as attachment

Is there any workaround to send out scheduled reports as Excel attachment than actually embedding it within an email? Salesforce scheduled reports embeds the report in email making further drill down ...
41
votes
9answers
37k views

Disable commandButton after first click to prevent double submission

I have an apex:commandButton on a visualforce page that invokes a method on the controller. There is currently no rerender value set for the button. Instead the controller method returns a ...
41
votes
2answers
6k views

Test.loadData() - undocumented (but useful) behavior loading relationships

Premise I want to load Accounts and their related Contacts using Test.loadData() and StaticResources. How do I do this given that the Contact records must have the ID of their parent Account yet the ...
41
votes
2answers
1k views

How can I tell what is changing in Salesforce as they patch each pod?

In another question where EU2 was behaving differently to EU5 I commented: For what its worth, trust is listing EU2 as "Release: Summer '15 Patch 9.6" and EU5 as "Release: Summer '15 Patch 10". NA1 ...
41
votes
1answer
3k views

Lightning Experience Bug: Picklist Color Values for Lightning Dashboards not working (UPDATE: fixed in Spring 18!)

Update This issue I've originally found in Winter 17 seems not fixed in Winter 18 release. However the issue does not affect Report Charts based on Opportunity.StageName - but on Custom Objects it's ...
40
votes
13answers
4k views

How do you manage passwords across SFDC orgs?

As an ISV partner I find myself juggling a bunch of username/passwords for my SFDC orgs. I have our "real" org where we do our own CRM related stuff. I have multiple dev orgs where we create our ...
40
votes
4answers
24k views

How do I generate a random string?

How does one generate a random string sequence with Apex? I need to generate a code when a particular object is created in our Salesforce environment. I'd like the code to contain numbers from 0-9 ...
40
votes
1answer
67k 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, ...
40
votes
2answers
10k views

What is Salesforce DX?

At Dreamforce 2016 Salesforce announced Salesforce DX. What is it and how will it affect development for Salesforce going forward?
40
votes
2answers
58k views

How to fix insufficient access rights on cross-reference id?

I am getting the error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] Scenario is, I am inserting an Opportunity and then Opportunity Line ...
40
votes
6answers
9k views

Is it possible to test apex that relies on field history tracking?

I have some code that relies on field history tracking by querying the History for a custom object. This works fine, but it appears that the history records aren't created during the test so none of ...
40
votes
1answer
7k views

Now that Lightning is here, what's the future of Visualforce? (in short - Visualforce vs Lightning)

As a developer, just curious to know what's the future of Visualforce (pages, components, email templates, etc..) ?? I believe for sure there will be backward compatibility so that the existing ones ...
39
votes
5answers
23k views

can salesforce handle 50 or 70 million records?

Can salesforce handle 50 or 70 million records? in the past I worked on the org which had 20 million tasks and it was real problem, so wanted to get experts thoughts on what is the impact if we ...
39
votes
2answers
14k views

What is suggested approach to transfer VF pages to be lightning ready

So I am planning to transfer our current VF pages to lightning ready. Most of our VF pages are based on a standard controller or standard set controller and use an extension. And they are pretty much ...
39
votes
1answer
6k views

How many SOQL queries are spent for subqueries?

Apex Governor Limits docs state that: In a SOQL query with parent-child relationship subqueries, each parent-child relationship counts as an extra query. However, when a query with a single ...
38
votes
4answers
11k 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 ...
38
votes
23answers
15k views

How can I convert a 15 char Id value into an 18 char Id value?

What is the formula for calculating the additional 3 characters needed to append to a 15 char Id in order to form its equivalent 18 char Id? I have a situation where I need to compare 15 char Ids (...
38
votes
3answers
58k views

Visualforce Date formatting

I need this date format in a visualforce page: "December 14, 2013". I can't seem to find the format options for visualforce. I read that it's the same as the java messageformat class options, but I ...
38
votes
3answers
43k views

SOQL vs SOSL - Which one to use and when?

What arguments can be made to use SOQL or SOSL? When would you use one over the other? What is the main difference?
38
votes
6answers
38k views

How to add a confirm dialog to a command button?

I'd think this would work just fine, but it seems to prevent the action function from firing regardless of the confirm response <apex:commandButton value="Remove All" action="{!removeAll}" ...
38
votes
8answers
5k views

Is there a way to setup continous integration for apex tests?

I would like to have continous integration (with Jenkins) for my apex code in order to run them automatically after each push to my git repository. Does anyone know a way how to do that?
38
votes
2answers
50k views

What is the difference between the “Salesforce” and “Salesforce Platform” licenses?

When creating or editing a Salesforce User, there is a picklist field that lets you assign a specific User License. In my Developer org, there are several options, two of which are confusing to me: ...
38
votes
2answers
658 views

Similar queries: Better to query twice or process via Apex?

I'm building a Visualforce page in which I want to display two similar (almost identical) lists of the same sObject -- one for objects with an Open status and one for Closed objects. I can think of ...
38
votes
3answers
3k views

How can I capture a system.limitexception stopping my emails being sent

In Salseforce governor limits, it states that every org is allowed to send single emails to 1000 external addresses every 24 hours. On very rare occasions, an org I work with has exceeded this limit ...
38
votes
1answer
607 views

Help me solve a concurrency mystery (platform bug? Expected behavior? Or am I missing something?)

To set up the problem, add a new currency data type custom field called Test_Counter__c to the Opportunity Object. Then create a test opportunity named TestOp. Then create the following class: ...
37
votes
4answers
29k views

Can I find out if the current user has access to a record without querying?

I run a query from an apex class (with sharing), and I get no results I can be sure the user doesn't have permissions (if I know otherwise that the records do exist). But can I get this information ...
37
votes
4answers
48k views

Difference between controller and extensions

Can any one explain the usage of controller and extensions in Visualforce? In which scenario we have to use controller and extensions? Thanks in advance
37
votes
2answers
2k views

Why Would I Not Enable Chaining?

The Apex Design Patterns is an awesome resource, and I learned many tricks from it. One of my favorites is method chaining, and I quickly developed an axiom: Any time you would return void, return ...
37
votes
6answers
4k views

Why do we still need to hack the Sidebar? Usecases - Workarounds - Alternatives

Since it seems to me, that a lot of people still need sidebar workarounds, I would be interested to learn about the use-cases, experienced challenges and (most important) possible strategies to avoid ...
37
votes
1answer
14k views

Infering sObject Type from Id or collection of Id's

If I have an instance of an Id variable that has been populated with a value, is there way to infer the sObject type of that Id using a describe call. So if I did: Set<id> parentIds = new ...
37
votes
3answers
25k views

What standard and custom fields are indexed?

I'm trying to find a proper list of what standard fields are indexed by default in salesforce, as well as under what conditions custom fields are indexed. To start things off I know fields are ...
37
votes
6answers
24k views

How to get the Runtime-Type of an Object dynamically (for Primitive Data Types and SObjects)

Is it possible to get the Type of an Object (it's not an SObject)? String s = 'test'; doSomething(s); public static void doSomething(o Object) { // need to find out if o is a string or an ...
36
votes
7answers
26k views

Copying metadata and code from one Production org to another

How do I copy(for want of a better word) metadata (i.e. Objects, Workflows, Validation rule etc), and code (Apex, Visualforce, Triggers) from one Production org to another production org? Is this ...

15 30 50 per page