Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [visualforce]

Visualforce relates to questions where the Visualforce language or framework are concerned. This is primarily VF pages, components, PDF rendering, and email templates. This would only cross-over to Lightning where Lightning Out (Lightning for VF) or VF pages using SLDS or being used in LEX. Where a question relates to Apex invoked as part of a VF page, this tag would also be appropriate.

118
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 ...
114
votes
1answer
16k 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 ...
57
votes
4answers
32k 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 ...
48
votes
1answer
14k 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 "...
44
votes
6answers
24k 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 ...
44
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
44
votes
1answer
32k 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 ...
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 ...
41
votes
1answer
683 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 ...
40
votes
9answers
35k 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 ...
39
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 ...
37
votes
6answers
37k 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}" ...
36
votes
3answers
45k 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
36
votes
3answers
53k 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 ...
36
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 ...
34
votes
2answers
21k views

Dynamic number of columns in a pageBlockTable

I would like to be able to dynamically control the columns displayed in a page block table. This would mean that if new fields are added to the object the controller and page do not have to be updated....
33
votes
5answers
30k views

Howto wildcard SELECT * to query all fields of objects in APEX?

I have created sObject and I need all the fields and I have many. Is there a way I can directly get all of them rather then typing each one of them.
33
votes
5answers
5k views

What is a good set of coding conventions for Salesforce development?

I've looked around in the Apex and Visualforce developer guides and around the web and can't seem to find any coding conventions out there. The Apex Dev guide has a section on Naming Conventions that ...
31
votes
5answers
10k views

Refreshing Formula Fields Dynamically (without save)

I have an "invoice" custom object which has a couple of summarising formula fields in. I also have a complicated and dynamic visualforce page for building the invoice objects. As the user is ...
31
votes
1answer
2k views

Does an Apex or VisualForce code style guide exist?

Has anyone written an Apex or VisualForce code style guide, in the way of the Ruby Style Guide or jslint, or PEP-8, or any number of Java guides? I'm in the process on creating one for internal use ...
30
votes
2answers
36k views

Is it possible to test list size from a VisualForce page?

Consider a simple example of a VF page that shows an account, with a pageBlockTable to display contacts on the account. But if there are no contacts for the accounts, instead of an empty table we ...
29
votes
2answers
33k views

Creating a custom list-view button that handles multi-record selection

I would like to create a custom button for a list-view that applies the same action to all the selected records in the list view. For instance, in the Cases list-view there are the Change Status and ...
29
votes
5answers
14k views

Detect if Visualforce Page is in Salesforce1

I have a Visualforce page that is used in both Salesforce1 and the desktop. On that page is a button. That button should only display if the user is loading the page on the desktop. It should be ...
29
votes
3answers
5k views

How to build custom UI that works both for users that have opted in to Lightning Experience and users that have not?

This isn't a question about the pros/cons of Lightning/Visualforce, but is a question about how to build custom UI for the period of time (a year or many years?) where some users/orgs have Lightning ...
27
votes
7answers
53k views

Where To start Learning With Salesforce Development

Where should I start learning? There are various topics to learn like Objects, Classes, Apex, Visualforce, SOSL, SOQL, Triggers, etc. There are so many options out there to start learning. I couldn't ...
26
votes
3answers
19k views

How should I build test methods for Visualforce Controller Extensions

I would like to know the best way to write test methods for controller extension classes that are used by Visualforce. What is the minimum set code that I need to cover the basic operation of the ...
25
votes
6answers
18k views

Is there a list of Salesforce images that can be used in custom pages and formula fields?

I have a Visualforce page that includes some Ajax functionality as follows: <apex:actionStatus id="searchtStatus" stopText=""> <apex:facet name="start"> Searching....<img ...
25
votes
2answers
11k views

Visualforce Locale specific date format

How can I go about displaying a date that is formatted to a users locale, for example me and my Australian friends use the format dd/MM/yyyy, while the Americans amoung us use MM/dd/yyyy. I know I can ...
25
votes
2answers
3k views

Why can Visualforce iterate over >1000 item collection if it's a map?

As per Visualforce Limits: Maximum number of collection items that can be iterated in an iteration component such as <apex:pageBlockTable> and <apex:repeat> -- 1,000 So normally 1,...
25
votes
1answer
263 views

Why documentation deep links are broken?

Since the Salesforce developer documentation was never the fastest UI ever made by man, I enjoyed the old FRAME layout which allowed me to create deep links to content I use frequently. Now having ...
25
votes
2answers
898 views

Javascript Remoting breaks on complex relationship data

We use Javascript Remoting to retrieve some complex data from the controller. The SOQL query looks like the following: SELECT Id, ( SELECT Id, Sales_Rep__r.Name, Customer__r.Name, ...
24
votes
4answers
16k views

How to sort Wrapper list?

I have a wrapper class which contains a list of sobjects, i want to have th sorting on the fields of these objects in the wrapper list: The apex code is as follows: Class jobsWrapper { public ...
24
votes
6answers
27k views

How do I build a multi-select picklist UI in visualforce?

I want to build a visualforce interface that allows me to display a list of available things on the left, and chosen things on the right? This one is hard to explain, so I've made an screen shot, ...
24
votes
3answers
6k views

How to make Mavensmate compile files as fast as Eclipse IDE v31

I'm a long time Eclipse and Force.com IDE user. I recently switched the the v31 (open source re-write) Eclipse plugin and discovered that the save times for Apex and Visualforce are drastically faster....
23
votes
1answer
22k views

Input placeholder in Visualforce page

How to show a default value in apex:inputText so that when user enters the text box the value should disappear like it does in this HTML: <input type="{!username}" id="username" placeholder="...
22
votes
2answers
126 views

Is knowledge for Visualforce relevant now?

We are planning to put a small team for taking care of our company's Salesforce instance. Most of the members in this new team do not have experience in Visualforce and as such we are wondering ...
22
votes
3answers
36k views

access controller variable in javascript

Is there any way to access controller variable set in a Method in Javascript. In the example above the value is set in constructor. But when I set it in a method it is showing as NULL in Javascript ...
22
votes
3answers
5k views

Javascript Remoting in Static Resource

Is it possible to call javascript remoting in a static resource? I'm creating an AngularJS application, and to stick with best practices I would like to put my services in separate files. Theses ...
22
votes
2answers
3k views

Spring 14 problem with pages that share the same controller

I think I've stumbled across a bug in Spring 14 that is breaking some of my code that is working in Winter 14. I have two pages that share the same controller. A button on the first page renders the ...
22
votes
1answer
3k views

Guidance on styling existing Visualforce pages adequately in Lightning Experience without major rework

PPS This thread pre-dates the <apex:page lightningStylesheets="true" ...that is the first thing to try now. Original Thread Note the existing point - these pages have already been written (there ...
21
votes
2answers
5k views

What actually happens on re-render?

I would like to know what actually happens on re-render (Ajax Call and DOM replacement) in Salesforce. My Idea: The ajax call is made to get data. On completion of the ajax call, the DOM is ...
20
votes
2answers
8k views

IE10 Forced into IE7 Standards document mode for Visualforce

I've created a VF page which leverages some nice CSS 3 and HTML 5 features but it doesn't render correctly on IE10. This is not because IE10 doesn't stick to standards, but because it's reverting to ...
20
votes
6answers
19k views

Passing custom string into a Salesforce email template.

I've stumbled upon a problem at the final stage of a new feature I was building (as always) I need to pass in a custom string into a salesforce template, however there doesnt seem to be a way of ...
20
votes
1answer
517 views

Restrict users from uploading signed PDFs

We have a customer portal where we allow our customers to upload several documents(PDF only) as required. These documents after getting uploaded to SFDC are then also sent to our other systems. ...
20
votes
3answers
19k views

'BLOB is not a valid UTF-8 string' error?

Im reading in a document that the user uploads from the visualFlow: <apex:inputFile value="{!contentFile}" filename="{!nameFile}" id="file"/> And its accessed in apex in this manner: String ...
20
votes
4answers
25k views

How to call parametrized function from Visualforce?

I have a parametrized helper function in my controller, which formats text according to requirements. public static string getFormatMe(string a) { // do manipulation here return a; } How do ...
20
votes
2answers
60k views

XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' is present

We have a customer who is having a problem with the embedded visualforce page for their custom objects that include our component. The issue is with the Cirrus_Files_Dog visualforce page. The page is ...
20
votes
1answer
219 views

Summer '16 appends orgId query string to certain static resources

I have just noticed something very worrying with the represented path to static resource files in Visualforce pages in Summer '16 boxes (sandbox and dev pre-release checked). It seems that for some ...
19
votes
3answers
8k views

Feasibility of Angularjs in visualforce pages?

Is it feasible to build visualforce pages with angularjs? Visualforce is itself a MVC framework. It has its own data-binding, data-transfer mechanism through viewstate. If angularjs is used, what ...
19
votes
5answers
10k views

salesforce1 look & feel in Visualforce

How to make a vf page with the same look & feel as salesforce1, any ideas?