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 [standardcontroller]

A StandardController is a built-in controller available for standard and custom objects to facilitate the easy creation of Visualforce pages.

13
votes
4answers
11k views

Required fields do not allow cancel

I have a custom VF page that I am using as a custom cases page, standardController="case". I have an apex:form with a few apex:inputField to create the boxes. Inside the form I have a save and cancel ...
13
votes
1answer
14k views

How do I access the fields of a custom object with a standard controller?

I have a custom object called "Shows." I'm writing a VisualForce page to display some custom data. My code is: <apex:page standardController="Show__c"> <apex:pageBlock id="thePageBlock"...
13
votes
2answers
4k views

Sort Order of Child Records Using a Standard Controller

Does anybody know of a way to order child records when accessed using a StandardController and displayed with an <apex:repeat> loop? My guess is that it can't be done and I need an extension, ...
11
votes
2answers
18k views

SObject row was retrieved via SOQL without querying the requested field in controller extension

I have written this controller extension: public with sharing class PopupController { ApexPages.Standardcontroller cont; public Request_Change_Reseller__c req{get;set;} public ...
8
votes
1answer
1k views

Standard Controller with Lightning

Is there a possibility where I can create a Lightning Component without writing a Custom APEX Controller? For example in Visualforce page we could use a StandardController and implement a standard ...
7
votes
1answer
1k views

How do I access the standard controller without passing the ID parameter in the URL

How can I use the standard controller to access fields on a record in a visualforce page without passing the ID in the URL? Example: Instead of "https://c.xxx.visual.force.com/apex/abc?id=...
7
votes
3answers
10k views

Passing standard controller SObject to a component: problem with custom fields

I want to create a page like this with 2 components: <apex:page standardController="Campaign"> <c:import campaign="{!campaign}" /> <c:message campaign="{!campaign}" /...
6
votes
2answers
5k views

Retrieving custom fields from a standard controller in an extension

How do I retrieve custom fields from a standard controller in a Visualforce extension controller? In the code below, if I remove the hard-coded ID "this.personParentId = '001Z000000CkZ4m';", it fails ...
6
votes
1answer
846 views

Can there be a Shared Extension across Multiple Overridden Visualforce Pages?

I would like to know if its possible to share a common extension class across multiple Visualforce Pages which use different standard Controllers. For Eg., I've VF_A Page which overrides default ...
6
votes
1answer
170 views

Queues, Email Notifications, Standard Controller Extensions. Oh My!

Created a controller extension for the standard case controler. we set the OwnerId using custom save logic, but it doesn't seem to matter what i do, Queue Notifications are never sent out to members. ...
6
votes
1answer
998 views

SObject row was retrieved via SOQL without querying the requested field. Transaction_Survey__c.Transaction_Score_Other_Reason__c

I'm getting this error in a Visualforce page I'm working on. I understand that this error comes up when you try to reference a field you haven't queried, but the problem is, I have it referenced on ...
6
votes
1answer
938 views

Visualforce error using standard controller in managed package

I have an inline visualforce page which uses a standard controller. I check values from the record object in javascript so I can display some other records in a popup based on the value of customfield....
6
votes
1answer
1k views

Standard Controller behavior with not available ids - behavior changed?

Question Do standard controllers no longer throw exceptions if the current user doesn't have access to the passed in id? Has this always been that case or did this just recently change? Hoping to ...
6
votes
1answer
1k views

which standard controller should be used to override Person account “New” and “Edit” Page using VF Page?

I am overriding person account standard Page with VF page. If I use standard controller as "Account" I am unable to get Picklist field values from "Person Account", If I use "Contact" as a Standard ...
5
votes
2answers
5k views

IN operator must be used with an iterable expression : For loop

I am getting Subject header error at below line. Can someone let me know what is the issue? Line: for (Compliance_Incident_abv__c myContact : [select ID,ManagerEmail_abv__c,RepEmail_abv__c,...
5
votes
1answer
623 views

What methods are available in the standard controller?

Motivation I'd like to use a lot of functionality from the standard controller and only add some additional fields. For example, Lead standard controller apparently provides filtered Converted ...
5
votes
1answer
99 views

standard controller | incorrect signature | extending classes

I have: public virtual classA{ public classA(ApexPages.StandardController controller){} } public virtual classA_Test extends classA{ classA_Test(){} } Error in classA_Test: Method does ...
5
votes
1answer
545 views

View state does not appear on pages using Standard controllers?

I am looking into 'View State Limit exceeded' error and want to display the View state information using the development mode footer. For my user, I have enabled both Development Mode and Show View ...
5
votes
1answer
273 views

Is there away to pull a users standard layout in edit mode and place it on a VF page?

I know there's a ways to do this using tag to view the detail page, but once you hit edit it will use salesforce standard edit page. I've also created a custom edit page but the problem I'm running ...
4
votes
2answers
1k views

Get the Id of an object in the standard controller without an extension?

Is it possible to get the Id of an object in a Visualforce page without a controller extension?
4
votes
1answer
1k views

Call controller method from different class

How can I call a method structured like this: public with sharing class Calculator { private ApexPages.StandardController l; public Calculator(ApexPages.StandardController l) { ... } ...
4
votes
1answer
3k views

Can you access parent object fields in a 'New' page override without using SOQL?

I have two objects, Parent__c and Child__c, Child__c has a lookup field to Parent__c calledParentId__c. I have overridden the New and Edit pages for Child__c using a Visualforce page with the ...
4
votes
3answers
4k views

Standard Controller OR Custom Controller

When and how to decide whether to go with Standard Controller OR Custom Controller? I have created so many vf pages,classes, extensions but still I'm not sure to include standard controller or custom ...
4
votes
1answer
2k views

Visualforce pageblocktable view of opportunities in account view - how to control the order?

I have created a table of 'sales data' in visualforce for display on accounts page, by creating custom fields within opportunities, and have created each 'opportunity' as a 'year' of sales data. the # ...
3
votes
2answers
18k views

How to Write Test Class for Standard Controller Along With Extensions

Hi Everyone I'm finding it difficult to write test class for this class Class public class SendEmailReceipt{ public Payment_Receipts__c Rec; public string em{get;set;} public id ...
3
votes
2answers
193 views

SOQL Issue Passing In AccountId

I believe it is my SOQL query that is giving me an issue. I need to take all of the notes and tasks (from the account that wrote them) and list them back out on the Account Page with a custom VF Page. ...
3
votes
2answers
5k views

Iterating over related records in visualforce using standard controller

I'm diving into visualforce and the standard controller for the first time and having trouble iterating over a single opportunity's related records. The below code produces an error: <apex:page ...
3
votes
1answer
10k views

Creating New record using Standard Controller and Extension

I have created a page using standard controller and extension. This page should create a record if no id passed and shuold update a record when id passed. Following is the controller public ...
3
votes
1answer
210 views

Overriding standard object to Visualforce page

I'm trying to override the standard page to a custom visualforce page and as you see in the screen shot I do not see the page that I have created, what I'm missing? SETUP-->CUSTOMIZE-->ACCOUNTS-...
3
votes
3answers
931 views

Getting error: Formula Expression is required on the action attributes

I have created a vf page with Contact standard controller to create a Contact record. User will create record in vf page and should be redirected to the related Contact detail page created. Here is ...
3
votes
1answer
737 views

How can I test create an instance of a VisualForce Controller Extension for testing?

Typical of custom controller extensions, my extension has a signature public MyVFCtrlExt (ApexPages.StandardController standardController) I'm currently trying to figure out how to write unit tests ...
3
votes
2answers
218 views

Can I send a user to an edit page which, when they press Save, will send them to the detail page?

Related: Can I send a user to a standard layout edit page at the end of a wizard? I have implemented a wizard that sends the user to the standard edit page at the end of the wizard. It's working ...
3
votes
1answer
5k views

Visualforce Page and standardController attribute in Apex Page

I am developing a Visualforce page which will be rendered when a Salesforce User arrives by clicking a specific Account. The Apex page looks something like this: <apex:page> <c:...
3
votes
5answers
4k views

How to reproduce standard page style in a Visualforce page

Motivation I'd like to reproduce a standard Lead conversion page style in a custom visualforce page. However, I'm seeing a number of differences. Some are in visual style, e.g. block section ...
3
votes
2answers
107 views

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

To minimize the complexity and number of distinct pages in my org I would like to use a single VF page to override both the standard Delete action and create a Delete list view action that allows a ...
3
votes
1answer
267 views

What controller to use for a visualforce tab?

I have a VisualForce page that uses an Apex class to provide extensions, and this is what I have when I put that page on the Contact page: <apex:page standardController="Contact" showHeader="false"...
3
votes
3answers
1k views

I am getting a SObject row was retrieved via SOQL without querying the requested field

I am getting a little lost here and have read the related topics on stackexchange carefully. I am using the standard controller for a custom object in a managed package. This code works perfectly in ...
3
votes
1answer
599 views

StandardController delete() method problem

Does somebody know what can cause the problem that StandardController delete() method doesn't delete the custom object from the context. My extension for Standard Controller has such method: public ...
3
votes
1answer
486 views

“Data not available” when using Database.rollback() in custom save action

In my custom edit page for LineItem__c records I have overriden the save button with my own implementation which does not only save the record itself but also change to child records. <apex:page ...
3
votes
1answer
600 views

Accessing parent by a standard controller

I have page which uses contact standard controller which is as below <apex:page standardController="contact"> {!contact.account.name} </apex:page> When I pass a valid id for contact ...
3
votes
1answer
5k views

Error: Unknown property 'OpportunityStandardController.opp'

I have a controller extension and I get the unknown property error on page load. public with sharing class ExtensionController{ public ApexPages.StandardController standardCon; ...
3
votes
0answers
898 views

apex:actionFunction action doesn't seem to work the same as apex:commandButton action

I am trying to override a custom object new and edit actions with a simple visualforce page. The desire is to not need a custom controller and just use the standard controller methods. <apex:page ...
3
votes
2answers
4k views

Displaying Person Account's “Last Name” , “Salutation” and “First Name” fields on a Visualforce Page [duplicate]

In my org i have enabled Person Account, and i have a visualforce page where i need to get Salutation,FirstName and LastName field from person account, But when i call it using <apex:inputField ...
2
votes
2answers
894 views

Id none must be 15 characters

I am getting below error during execution time for below code in Apex page. I am unable to assign the value from here to standard controller. Can someone please help me? Apex Page <apex:...
2
votes
2answers
6k views

Unknown constructor 'Name.Name(ApexPages.StandardSetController controller)' when removing RecordSetVar

I am attempting to convert my page to work from List View button into Detail Page button. When I attempt to remove the recordsetvar, I get the mentioned error. Unknown constructor '...
2
votes
2answers
84 views

Embedded VF Page Not Responding To StandardController

I am trying to embed a custom VF page into my Accounts layout. I believe my error is in the standardController. I assumed it should be SObject but it did not work and now I am not 100% sure what it ...
2
votes
2answers
3k views

Unknown Property on Controller Extension

So I have a standard controller and an extension that I'm trying to use to call back a list from a different object to use in a PageBlockTable. In the visualforce page I declare my standard ...
2
votes
1answer
39 views

Get name of standard action overriden in Visualforce contorller

I have a visualforce page that overrides both the 'New' and 'Edit' Buttons of a custom object. In my controller extension how can I get the name of the action that called this page ? I don't see ...
2
votes
2answers
433 views

How can a developer display the Name from the parent Account record on the page?

While preparing myself to the Developer 1 certification I met the following question: A Visualforce page uses the Contact standard controller. How can a developer display the Name from the parent ...
2
votes
1answer
121 views

Fetching related objects data from standardcontroller extension into visualforce page

public class TrackerExt { public String OpportunityId {get;set;} private final Opportunity opp; public List<Tracker__c> trackers{get; set;} public TrackerExt(ApexPages....