You need to sign in to do that
Don't have an account?

Creating a vf form from a custom object
I am looking for a little help I am pretty much brand new to VF and other than training I have never actually done anything functional in it. I am trying to create a form from a custom object but keep getting the error Coul not resolvve the entity from <apex:inputField> value binding '{!Initial_Investment_Costs__c}", <apex:inputField> can only be sused with SObjects, or objects that are Visualforce field component resolvable. But I cannot figure out what is the problem. My VF page is below.
<apex:page standardController="CapEx_OpEx_Initial_Investment_Costs__c">
<apex:form>
<apex:pageBlock title="Add Initial Investment Costs">
<apex:inputField value="{! Initial_Investment_Costs__c}"/>
<apex:inputField value="{! If_Other_Please_Specify__c}"/>
<apex:inputField value="{! Year_0__c}"/>
<apex:inputField value="{! Year_1__c}"/>
<apex:inputField value="{! Year_2__c}"/>
<apex:inputField value="{! Year_3__c}"/>
<apex:inputField value="{! Additional_Notes__c}"/>
<apex:pageBlockButtons>
<apex:commandButton action="{! save }" value="Save" />
<apex:commandButton action="{! save&New }" value="Save & New" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page standardController="CapEx_OpEx_Initial_Investment_Costs__c">
<apex:form>
<apex:pageBlock title="Add Initial Investment Costs">
<apex:inputField value="{! Initial_Investment_Costs__c}"/>
<apex:inputField value="{! If_Other_Please_Specify__c}"/>
<apex:inputField value="{! Year_0__c}"/>
<apex:inputField value="{! Year_1__c}"/>
<apex:inputField value="{! Year_2__c}"/>
<apex:inputField value="{! Year_3__c}"/>
<apex:inputField value="{! Additional_Notes__c}"/>
<apex:pageBlockButtons>
<apex:commandButton action="{! save }" value="Save" />
<apex:commandButton action="{! save&New }" value="Save & New" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
If this helps you solve your problem, please like it.
I have just tried the above code for Account standardcontroller and found that 'Save & New' action does not support with standard controllers. Please remove <apex:commandButton action="{! save&New }" value="Save & New" /> statement from vf code and try to save it.
Thanks,
Pankaj
,
Pankaj is right there is no such method as save and new in standard controller you have to do simple customisation to achive this .Please use below code it will solve your problem .Onclick of save it will redirect to the record detail page ,but save and new will create record and allow you to create one more record .