Skip to main content
9 votes
Accepted

Variable is not visible

You cannot assign to a property AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url'); if that property does not have a setter method declared. To make the property ...
David Reed's user avatar
  • 93.2k
6 votes

Complete list of Standard Field Validation Error Messages

The strings are version and language dependent. However, there is a way to find which codes are valid for a particular release: go into Setup > Develop > API, generate the Enterprise WSDL, and find ...
sfdcfox's user avatar
  • 497k
6 votes
Accepted

Displaying an error message on a visualforce page

You need to rerender pageMessages section by commandButton's attribute <apex:pageBlock> <apex:pageMessages id="msgId"/> <apex:commandButton name="Submit" action="{!exchangeInv}...
Santanu Boral's user avatar
6 votes
Accepted

Difficulty creating test class on custom controller for table VF page that lists records from custom object

That's a good start. You're inserting one record in your test class. The problem is, you don't even call your controller in your test, so it can't be test. Your code is never executed. So after ...
Martin Lezer's user avatar
  • 7,295
5 votes
Accepted

Test Class for Chart Controller

Your test would just instantiate the class and request the list: @isTest static void test() { PieChartController ctrl = new PieChartController(); PieChartController.PieWedgeData[] data = ctrl....
sfdcfox's user avatar
  • 497k
5 votes
Accepted

How to repeatedly poll a server-side controller for an action in a Lightning Component?

So I've finally figured it out. It looks like it's possible to repeatedly poll the server-side controller. For the first, I put setTimeout inside of the action's callback, at the bottom of function's ...
Przemysław Długoszewski-Tamoń's user avatar
4 votes
Accepted

Is it possible to use a field set with a custom controller?

It is completely possible: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_field_sets.htm <apex:page standardController="Account"> <apex:repeat value=...
Eric's user avatar
  • 54.2k
4 votes
Accepted

How to solve the apex:attribute and assignTo naming conflict?

Using generic terms on one side or the other can help. So instead of rentalContract, use record (single instance of an SObject) or, instead of rentalContractId, use recordId. Even these two alone give ...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

finishLocation seems to work, retUrl does not

Looking at how that parameter is cased in other parts of the system, I see retURL. These url parameters are case-sensitive, and code looking for retURL will not find a retUrl parameter.
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

Where can I find a documentation of Lightning server-side controller's response?

My understanding is the response object param coming back into the callback function is nothing but a representation of the Aura Action object. So you will have all of the properties and methods of ...
Vamsi Krishna Gosu's user avatar
4 votes

How to repeatedly poll a server-side controller for an action in a Lightning Component?

Since the actions are asynchronous, they will not execute in the order you expect. Your code works, you just need to you leave your console open long enough and you will see batches of server side ...
glls's user avatar
  • 20.2k
4 votes
Accepted

How to insert/create a record in custom object using custom controller

With the controller you have it should be the variable name {!user. not {!Users__c. in the page. When you use a standard controller the variable defaults to the type name but here you have picked the ...
Keith C's user avatar
  • 136k
4 votes

Custom controller won't work in component?

This won't work because "a lightning component" and "a visualforce page" is not same as per their structure and their intent. They both follow different framework. A VF (visual force) page is more "...
Jayant Das's user avatar
  • 30.6k
4 votes

IF clause in VF page to render PDF

If you are calling this visualforce from button click event through controller method then, you need to put the condition at that place. public PageReference openPDFPage() { TTD_Letter__C ...
Santanu Boral's user avatar
4 votes

Visualforce page can't find my method?

"value" attributes always map to get/set methods, while "action" methods always refer to the exact method name. <apex:outputText value="{!returnOppId}" ... Will call: public String ...
sfdcfox's user avatar
  • 497k
4 votes
Accepted

while calling method showing variable undefine in lightning component

You should actually need to use JSON syntax to pass params using action.setParams() method. So in your case you need to pass it either like this: action.setParams({str:sear}); Or like this: action....
Bartosz Śliwiński's user avatar
4 votes
Accepted

unable to abort queued scheduled job

You have forgotten the ; in the code on the end of the line. If you change your code to this, it will work: System.abortJob('jobid');
Theodoor's user avatar
  • 461
4 votes
Accepted

How to get the public key in form of JWS Key set

The JWKS is located based on a URL specified in OpenID Connect metadata. The discovery of OIDC metadata uses a special endpoint that Salesforce already provides out of the box and you won't be able to ...
identigral's user avatar
  • 7,690
3 votes
Accepted

Passing different value (link value) from VF page to VF component and display it on screen

Try with code below. I reused your commented inTaskId attribute on your Visualforce Component, and passed the selected tab value through it. Also, my code re-renders the actual component, and not the ...
smukov's user avatar
  • 5,613
3 votes
Accepted

Test.setCurrentPage not start the controller constructor?

Test methods "don't initialize a full Visualforce stack" (I was told this by an engineer). In other words, you don't get anything "for free," so you must initialize anything that would happen ...
sfdcfox's user avatar
  • 497k
3 votes

Pie Chart not showing anything on Visualforce Page

Below is an example of a pie chart that will display. The key thing to check when working with apex:chart is your browser's console as most errors are reported there from the JavaScript that renders ...
Keith C's user avatar
  • 136k
3 votes

How to use pageMessages and have exceptions in controller tests

You can use following code to assert if page message to be properly displayed. Create a dataset for which it can generate error message in doSomething() method. @isTest private class MyControllerTest ...
Santanu Boral's user avatar
3 votes
Accepted

Test Class for Redirect Custom Controller

In your method CaseRedirect you have an IF condition based on page parameters. In your test code, you do not specify any page parameters so it will always go to the "Else" part of the logic. You ...
Doug B's user avatar
  • 11.5k
3 votes
Accepted

Decision to use Custom Controller rather than Controller Extension

According to me answer will be 1 and 3. Controller extension leverages the built-in-functionality of Standard Controller, but overrides one or more actions. Where as, Custom Controller replaces the ...
Santanu Boral's user avatar
3 votes
Accepted

Visualforce page controller compile error - not recognizing variable in controller

The error basically says that you are trying to reply a change to the controller and that change cannot be made because it is being used on an existing VF page. I saved your class and then save the ...
Eric's user avatar
  • 54.2k
3 votes
Accepted

How to use extension with custom controller

You would need to update extension's constructor to link it to the Controller. If your controller is: public class InstagramIntegration { // constructor public InstagramIntegration() { ...
Raul's user avatar
  • 18.8k
3 votes
Accepted

Test controller cover only 10%

This is one of the most common question types that we get here. As such, there are a lot of similar questions here that you can search for that would provide guidance. Some people like to close ...
Derek F's user avatar
  • 62.7k
3 votes
Accepted

format .cls file in Visual Studio Code

There isn't an official Apex code formatter available right now. The GitHub repository for the Salesforce Visual Studio Code extension package has an open issue for this, and they've solicited ...
David Reed's user avatar
  • 93.2k
3 votes
Accepted

Unknown property 'String.Id'

You have a namespace collision between your pageBlockTable iteration variable and a property on your controller class. <apex:pageBlockTable value="{!existingTTList}" var="xt"> public String ...
David Reed's user avatar
  • 93.2k
3 votes

Issue with Action support inside a selectlist

I finally did it! thought of sharing this so that it would be helpful for someone! VF page: <style> td{ text-align:center; } </style> <apex:form &...
S.Sujendran's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible