You need to sign in to do that
Don't have an account?
kcnmahesh
Overriding new Button....Disply existing records while creating new record
Hi...,
My requirement is to display all existing records at the time of creating a new record.
Means i need to override NEW button with visualforce page and i need to display all existing records with the help of controller.
I am not getting the logic .
can anyone help me on this requirement plz....?
It looks like your GETer isn't public...
All Answers
Here is my code.....
VisualforcePage..
<apex:page standardController="Why_Why_Analysis__c" extensions="WhyAnalysisController" action="{!query}">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!why}" var="a">
<apex:outputField value="{!a.Fishbone_Analysis__c}">
</apex:outputField>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:inputField value="{!Why_Why_Analysis__c.Fishbone_Analysis__c}"/>
<apex:inputField value="{!Why_Why_Analysis__c.Root_Cause__c}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
COntroller.....
public with sharing class WhyAnalysisController {
public WhyAnalysisController(ApexPages.StandardController controller) {
}
List<Why_Why_Analysis__c> why {get;set;}
public pageReference save(){
return null;
}
public pageReference query(){
why = new List<Why_Why_Analysis__c>();
why = [ select id , Fishbone_Analysis__c , Name from Why_Why_Analysis__c ];
return null;
}
}
But its showing Error message..
"Unknown Property why"
It looks like your GETer isn't public...
Hi....,
Its working fine.
I deleted "With sharing" and i make that list as "public".
Thanks TECHMAN.