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.

46
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 "...
43
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 ...
27
votes
7answers
52k 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 ...
35
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 ...
16
votes
2answers
19k views

System.CalloutException: You have uncommitted work pending

I have same exception can please Click Here The previous post issue is resolved. Exception: :System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out ...
117
votes
2answers
23k 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 ...
35
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
54
votes
4answers
30k 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 ...
43
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
28
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 ...
39
votes
9answers
34k 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 ...
14
votes
1answer
44k views

How to pass javascript value to controller..?

I want to pass the java-script value to controller.I am using repeat on VF page. VF page <apex:repeat value="{!listAdj}" var="Adj" id="hrs"> <td><div class="requiredInput"&...
14
votes
4answers
16k views

apex:inputFile can't be used in conjunction with an action component when deleting a row

When working on a visualforce page, I encountered this error: "apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a ...
113
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 ...
7
votes
1answer
10k views

Why does apex:param assignTo work with apex:commandLink but not apex:commandButton?

How do command buttons and command links differ when it comes to using <apex:param>? The param value is not being passed to the controller. I have the following code in a Controller : public ...
38
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 ...
18
votes
2answers
3k views

Lightning Components in Visualforce - Unable to read sobject

I've started seeing this error since the Spring 16 release when I retrieve an sobject from the Apex controller, update it and then send it back to the server. I originally thought this was down to a $...
9
votes
2answers
2k views

Field Values In Dynamic Component Not Retaining After Error

I updated the question due to the issue being specifically for a dynamic component Currently, I have a custom VisualForce page used to fill out a new Opportunity. Everything works as intended except ...
27
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 ...
42
votes
1answer
31k 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 ...
35
votes
3answers
51k 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 ...
33
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....
24
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 ...
11
votes
2answers
4k views

Are dependent picklists supported in Lightning Components?

It's possible to define dependent picklist in the setup and the are supported out-of-the-box in Visualforce. Are they also supported in Lightning natively? Is it on the roadmap to support them soon? ...
5
votes
1answer
6k views

To achieve Grand total for the retrieved column in a datatable generated using Soql

I have created a VF tab in which i have retrieved the data with a SOQL statement and displayed the same with VF page using a datatable to make it as a customized report. I can't find a proper solution ...
36
votes
6answers
36k 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}" ...
32
votes
5answers
28k 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.
18
votes
3answers
12k views

Multiple controller extensions communication

I have a Visualforce page with two controller extensions. Is there any way to get a reference to one of the extensions in the other one?
10
votes
3answers
7k views

How to convert a Visualforce apex:pageMessages to be lightning style

During my working on converting existing pages to be lightning experience style (as known as slds style). One of the challenges I have faced is to convert <apex:pageMessages/> . Usually the ...
14
votes
6answers
12k views

File Attachment Upload - Maximum View State Size limit (135kB)exceeded

I have used simple code to upload File. Now My page is giving me the following error: Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 838.719KB I have ...
9
votes
1answer
9k views

Removing rows separately from the Visualforce pageBlockTable list

I created a visualforce page (with controller) that allows adding multiple records to a custom object (master object is account). I can add new rows and save the new records, I'm also pulling ...
8
votes
2answers
7k views

reports embedded in visualforce not showing

I have a few reports embedded in visualforce page using iFrame. Due to this new release of Spring '14, iFrame has stopped working and now these visualforce pages show blank screens. Can anyone help me ...
16
votes
3answers
5k views

word-wrap not working with VisualForce PDF generation?

I cannot get word-wrap to work in a VisualForce page, which is rendered as a PDF. There is a table with a column called Comments and this contains a long string without any spaces. The long string is ...
9
votes
5answers
25k views

Popup “spinner” style apex:actionStatus

Has anyone been able to make the apex:actionStatus tag display in the popup spinner style, like this: It should render center of screen, perhaps with a masking effect. If I'm not mistken, the extJS ...
10
votes
1answer
19k views

How to handle Maps on Visualforce page

Can anyone please help me to understand the below code. I am not able to understand how we are extracting value from map on visualforce page. Actually i am trying to get the size of value list which ...
4
votes
3answers
7k views

Need to Pass the values as hidden in Url in Salesforce

Has anyone have the idea of passing the values as hidden in url for example I need to pass the values of First Name,Last name,email,address & so on \apex\page2?fn=test&ln=test&email=...
14
votes
3answers
5k views

Salesforce Metadata Api/ Tooling Api to build changesets

I was wondering if it was possible to use any of the API's provided by SF to build an external (C#, Java) application to manage building changesets. Building changesets is very tedious when trying ...
13
votes
5answers
13k views

How to call Apex REST API from Javascript?

I have two different developer orgs. One contains apex REST web service, and I want to call that REST service from my second org. I have tried to call that REST service using normal ajax post request ...
19
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 ...
9
votes
4answers
17k views

Showing a Lightning Component/App inside Visualforce Page

Is it possible to show a Lightning Component/App inside a Visualforce Page??
18
votes
3answers
21k views

Best practice for calling Apex methods from custom button?

I want to put a custom button on a standard detail page layout to execute Apex code, and I'm wondering if using VF page action attribute is the best practice. Here are the details. When the user ...
29
votes
2answers
35k 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 ...
24
votes
2answers
2k 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,...
15
votes
4answers
22k views

Apex:OutputText to Currency Format from String Wrapper

is there a way to pass a string to the <apex:outputText> so that it can be formatted as a currency or percent value? Here's what I have inside a column of my visual force table: <apex:...
11
votes
4answers
12k views

How can I dynamically render required fields using a Dynamic Component

Background I have a Visualforce page on which I am rendering a lot of fields using a Dynamic Component (which is an Output Panel that contains all of the fields). The fields are added based on a ...
10
votes
5answers
13k views

How do I support scrolling and lock/freeze the header row of a pageBlockTable?

The following example code adds a scrollbar around the table if the number of items results in a table that has a height that is greater than 500px. <apex:outputPanel layout="block" style="...
7
votes
2answers
5k views

Add more than 1000 picklist values in visualforce page (controller 1000 list items limit)

I have following code - Page - <apex:selectList value="{!selectContactId}" multiselect="false" size="1" id="RelatedContact"> <apex:selectOptions value="{!relatedContacts}"/> </...
7
votes
4answers
1k views

Mandatory child record when creating parent record

The standard object Account has a master-detail relationship with a child object called Address__c. In the Address__c object we store the various addresses an account might have. My question is as ...
6
votes
3answers
1k views

Dynamic components on a Visualforce page

I want to create a VF page inside which I will have component, where the user will have the flexibility to change the component without touching the code of the page. Dynamic, like this: <apex:...
5
votes
2answers
4k views

Retrieving an image from rich text field?

Have a rich text field called - snapshot__c which has image in it. This field is inside custom object called obj__c. obj__c has another field case__c using lookup in it. On a Vf page, I'm selecting ...