Skip to main content
7 votes
Accepted

Get ID from URL

Have you tried simply: JobID = sc.getId(); See docs here. This assumes that the standardController attribute on your page is for Job__c and that the URL is something like /apex/YourPage?id=[some ...
Phil Hawthorn's user avatar
5 votes
Accepted

Overriding standard object to Visualforce page

If you want to override the List action, you must use a StandardSetController, which you introduce with the recordSetVar attribute. <apex:page standardController="Account" recordSetVar="accounts"&...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

StandardSetController Not Retrieving Records

The reason for this behavior is that the page is displaying the accounts based on the last filter you've used. To fix this, try accessing the Account tab and then click on All Accounts in the View. ...
Anil's user avatar
  • 306
4 votes
Accepted

SOQL Issue Passing In AccountId

According to the documentation: Note Represents a note, which is text associated with a custom object or a standard object, such as a Contact, Contract, or Opportunity. Where Field ParentId is ID of ...
Ilya Lepesh's user avatar
  • 4,125
4 votes
Accepted

Passing InputText to Controller Extension

The getter is returning the original value that was queried. Just use a normal getter, and assign the default value in your constructor. public i3_ProjectTimesheet_Controller_Edit(ApexPages....
sfdcfox's user avatar
  • 497k
3 votes

Can a single VF page override both a standard action and a list action?

It is not possible for a single VF page to do this, but you can create 2 VF pages and have them use the same controller extension, using the same notation you used above. Single Record Handler <...
abd3721's user avatar
  • 2,162
3 votes
Accepted

Not able to get Record ID from record

You need to change your URL https://c.cs26.visual.force.com/apex/TestProduct?id=a0‌​B21000001SSzP If you are using different parameter name then you need to get the value using getpararmeters() ...
Tushar Sharma's user avatar
3 votes

VF page doesn't show the fields

It seems you're passing the record ID of some other object to the page, not a task. The prefix for a task ID is 00T, you have a02 which leads me to believe you're passing the ID of a custom object ...
Matt Lacey's user avatar
  • 25.7k
3 votes
Accepted

Custom Object as Standard Controller: Plural Or Singular

When you create a custom object you choose: Label Plural Label Object Name While it is convention to use a singular name for a table (AKA an SObject) it sounds like you chose a plural name. If you ...
Keith C's user avatar
  • 136k
3 votes
Accepted

Code For StandardController Works With One Object But Not All. Why?

The problem's with your query. You're filtering by AccountId on Task, so it doesn't work for Lead or Opportunity (because AccountId will never be a 00Q or 006 Id). Instead, try the following change: ...
sfdcfox's user avatar
  • 497k
3 votes

SOQL Issue Passing In AccountId

To expand on @Ilya's answer. The sObjectType of the actId variable is Account. If you filter Id = :actId, the only table you can ever query and get any results for is Account*: SELECT ... FROM ...
Adrian Larson's user avatar
  • 151k
3 votes

Getting error: Formula Expression is required on the action attributes

Don't use an extension unless you need to. You can reduce your entire page to just: <apex:page standardController="Contact"> <apex:form> <apex:pageBlock> <...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

Embedded VF Page Not Responding To StandardController

If you are extending a standard controller then the extension controller class requires a standardcontroller as a constructor parameter So your constructor will look like below public ...
Mohith Shrivastava's user avatar
3 votes

Accessing campaign field of lead

If you look at the documentation on the Lead object, there is no CampaignId field (nor any reference to Campaign. However, if you wanted to loop through the Campaigns a Lead is joined to, there is a ...
Adrian Larson's user avatar
  • 151k
3 votes
Accepted

Get data from apex standardcontroller into extension

I would suggest you also go through a nice blog written by Bob, where he has explained everything about how to get extra fields of record in extension. http://bobbuzzard.blogspot.in/2011/04/dynamic-...
Nitish Singhal's user avatar
3 votes
Accepted

Field updating in client but not server

To update a record you need to have Id. cList doesn't have Id. So, use the following logic in your loop and update the records. List<Customer_Product__c> cList = new List<...
Santanu Boral's user avatar
3 votes

AppExchange ISV Security Review CRUD/FLS Puzzler

FLS is not automatically enforced just because you used "with sharing." You must check for access to the field before you display it to the user. Typically, if you use apex:inputField or apex:...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

Combine apex class for VF pages that use a standard controller and a controller?

You can definitely do this. The key is to have two different constructors - one that accepts the standard controller and one with empty params. Something like: public class ...
Caspar Harmer's user avatar
3 votes
Accepted

Fetching related objects data from standardcontroller extension into visualforce page

You are trying to access the Tracker__c objects by using merge syntax ({!trackers}). This implicitly looks for a method called getTrackers() in the controller and extensions. I think if you re-name ...
Jeff Bennett's user avatar
3 votes
Accepted

Standard controller and extension method with same name

Any extension methods take precedence over controller methods with the same name. Take a look at Building a Controller Extension: Multiple controller extensions can be defined for a single page ...
Adrian Larson's user avatar
  • 151k
3 votes

Get type of record from standard controller without accessing record?

So, I guess the only way to get the type of an object in a ApexPages.StandardController without accessing the record itself is to use String.ValueOf to get a text representation of the object ...
battery.cord's user avatar
  • 8,845
3 votes
Accepted

New custom field missing in standard controller?

The standard controller for Public_Seminar__c on your containing page, which is responsible for querying the record that you assignTo="{!ControlCourse}" to pass into the Visualforce component, doesn't ...
David Reed's user avatar
  • 93.2k
3 votes
Accepted

Get name of standard action overriden in Visualforce contorller

I don't know if there's any standard way to do so, but you can utilize an approach here in your Extension's constructor to identify if the click was from New or Edit. When you click on New button, ...
Jayant Das's user avatar
  • 30.6k
3 votes
Accepted

Error in Test class having StandardController

Your query relies on getting an Id from the page parameters, so your test needs to set that before your constructor is called. No Id = query returns no rows. Combine that with assigning the result ...
Derek F's user avatar
  • 62.8k
2 votes

Embedded VF Page Not Responding To StandardController

Change your constructor of your extension class into: public noteandtask_controller(ApexPages.StandardController stdController){ //... And your issue will be gone. For a standardcontroller ...
Lance Shi's user avatar
  • 13k
2 votes
Accepted

View state does not appear on pages using Standard controllers?

What the message states is that you need some custom Apex code for the page to bother serializing the View State and sending it to the server. There are two ways to do so. Use a standard controller ...
Adrian Larson's user avatar
  • 151k
2 votes

Can anyone find the bug in this code

You can try something like below to insert Contact and Redirect to custom page. Basically, what you require here to insert the Contact record and redirect to custom page. To Redirect, you need to ...
Devendra's user avatar
  • 5,075
2 votes

Required fields do not allow cancel

To add to the knowledge above, there is also a known issue with HTML-5 and commandbuttons which use "immediate=true": https://success.salesforce.com/issues_view?id=a1p300000008YvNAAU Even with ...
Bigears's user avatar
  • 1,131
2 votes
Accepted

Problems overriding NEW-button for Contact in Standard Controller Action

retURL- expects a valid URL. In your example you have retURL=URLFOR($Action.Contact.View, Contact.Id), so at run time the retURL becomes invalid as Contact is not created yet. Ideally on click of ...
Raul's user avatar
  • 18.8k
2 votes
Accepted

Exposing Vf Page on the Account Object

Any page that you want to include in the Account layout must use that standard controller: <apex:page standardController="Account"> If you want to add a child object, you may need to add an ...
Adrian Larson's user avatar
  • 151k

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