• nagu90007
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies

Visualforce page:

------------------------

<apex:page standardController="Proposal__c" extensions="npList">
<apex:sectionHeader subtitle="New Proposal" title="Proposal Edit" />
<apex:form >
<apex:pageBlock title="Proposal Edit">

<apex:pageBlockButtons location="top">
<apex:commandButton action="{!gettingRecords}" value="Records List" immediate="true"/>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveandnew}" value="Save & New"/>
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
</apex:pageBlockButtons>

<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!gettingRecords}" value="Records List" immediate="true"/>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveandnew}" value="Save & New"/>
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
</apex:pageBlockButtons>

<apex:pageBlockSection title="Information">
<apex:inputField value="{!acc.Name}" required="true"/>
<apex:inputField value="{!acc.Opportunity__c}" required="true"/>
<apex:inputField value="{!acc.Proposal_Name__c}"/>
<apex:inputField value="{!acc.Initial_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Type__c}"/>
<apex:inputField value="{!acc.Mid_Poin_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Recieved__c}"/>
<apex:inputField value="{!acc.Final_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Due_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Submit_Date__c}"/>
<apex:inputField value="{!acc.Down_Select_Target_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Final_Selection_Date__c}"/>
<apex:inputField value="{!acc.RFP_Selected__c}"/>
<apex:inputField value="{!acc.Link_to_Proposal__c}"/>
<apex:inputField value="{!acc.Status__c}"/>
<apex:inputField value="{!acc.Link_to_Pricing__c}"/>
<apex:inputField value="{!acc.Down_Selected__c}"/>
<apex:inputField value="{!acc.Down_Selected_Date__c}"/>
</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>

</apex:page>

 

 

 

 

 

 

controller:

--------------

 

public with sharing class npList {
private ApexPages.StandardController controller {get; set;}
public npList(ApexPages.StandardController controller) {
// controller.npList =null;
}
public Proposal__c acc {get;set;}
public String getProposal() {
return null;
}
public npList()
{
acc = new Proposal__c();
}
public PageReference gettingRecords() {
PageReference submissionPage = new PageReference('https://ap1.salesforce.com/a07/o');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference save() {
insert acc;
PageReference submissionPage = new PageReference('https://ap1.salesforce.com/006/o');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference saveandnew() {
insert acc;
PageReference submissionPage = new PageReference('https://c.ap1.visual.force.com/apex/np');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference cancel() {
PageReference submissionPage = new PageReference('https://c.ap1.visual.force.com/apex/np');
return null;
}}

 

 

 

Hi ,

Here I created one visualforce page and save and save&new button.Here my problem is,if  i click on save and save & new button then i will get an error like "System.NullPointerException: Attempt to de-reference a null object',"Error is in expression '{!save}' in page np" . Here the records are not stored into particular object ,so let me know what is the solution for this error and how to save the values.

 

Thanks in advance....

 

Visualforce page:

------------------------

<apex:page standardController="Proposal__c" extensions="npList">
<apex:sectionHeader subtitle="New Proposal" title="Proposal Edit" />
<apex:form >
<apex:pageBlock title="Proposal Edit">

<apex:pageBlockButtons location="top">
<apex:commandButton action="{!gettingRecords}" value="Records List" immediate="true"/>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveandnew}" value="Save & New"/>
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
</apex:pageBlockButtons>

<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!gettingRecords}" value="Records List" immediate="true"/>
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveandnew}" value="Save & New"/>
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
</apex:pageBlockButtons>

<apex:pageBlockSection title="Information">
<apex:inputField value="{!acc.Name}" required="true"/>
<apex:inputField value="{!acc.Opportunity__c}" required="true"/>
<apex:inputField value="{!acc.Proposal_Name__c}"/>
<apex:inputField value="{!acc.Initial_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Type__c}"/>
<apex:inputField value="{!acc.Mid_Poin_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Recieved__c}"/>
<apex:inputField value="{!acc.Final_Deal_Review_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Due_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Submit_Date__c}"/>
<apex:inputField value="{!acc.Down_Select_Target_Date__c}"/>
<apex:inputField value="{!acc.Proposal_Final_Selection_Date__c}"/>
<apex:inputField value="{!acc.RFP_Selected__c}"/>
<apex:inputField value="{!acc.Link_to_Proposal__c}"/>
<apex:inputField value="{!acc.Status__c}"/>
<apex:inputField value="{!acc.Link_to_Pricing__c}"/>
<apex:inputField value="{!acc.Down_Selected__c}"/>
<apex:inputField value="{!acc.Down_Selected_Date__c}"/>
</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>

</apex:page>

 

 

 

 

 

 

controller:

--------------

 

public with sharing class npList {
private ApexPages.StandardController controller {get; set;}
public npList(ApexPages.StandardController controller) {
// controller.npList =null;
}
public Proposal__c acc {get;set;}
public String getProposal() {
return null;
}
public npList()
{
acc = new Proposal__c();
}
public PageReference gettingRecords() {
PageReference submissionPage = new PageReference('https://ap1.salesforce.com/a07/o');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference save() {
insert acc;
PageReference submissionPage = new PageReference('https://ap1.salesforce.com/006/o');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference saveandnew() {
insert acc;
PageReference submissionPage = new PageReference('https://c.ap1.visual.force.com/apex/np');
submissionPage.setRedirect(true);
return submissionPage;
}
public PageReference cancel() {
PageReference submissionPage = new PageReference('https://c.ap1.visual.force.com/apex/np');
return null;
}}

 

 

 

Hi ,

Here I created one visualforce page and save and save&new button.Here my problem is,if  i click on save and save & new button then i will get an error like "System.NullPointerException: Attempt to de-reference a null object',"Error is in expression '{!save}' in page np" . Here the records are not stored into particular object ,so let me know what is the solution for this error and how to save the values.

 

Thanks in advance....