function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rakesh ERakesh E 

New record not getting inserted using standard controller for custom object.

I have created a custom object todoitem__c and iam trying to insert new record into this object using standardcontroller as shown below

 

<apex:page standardController="toDoItem__c" >
<apex:form>
<apex:pageBlock title="Save Item">
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputField value="{!toDoItem__c.name}"/>

<apex:inputField value="{!toDoItem__c.dueDate__c}"/>
<apex:inputField value="{!toDoItem__c.itemNumber__c}"/>
</apex:pageBlockSection>

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

 

 

but the record is not getting inserted.

please let me know am i doing any mistake here 

 

 

thank you

Best Answer chosen by Admin (Salesforce Developers) 
SFDC-SDSFDC-SD

if you still don't see the values, check the debug logs...

25.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
22:51:19.024 (24165000)|EXECUTION_STARTED
22:51:19.024 (24228000)|CODE_UNIT_STARTED|[EXTERNAL]|066E0000000zLtC|VF: /apex/sample123__Expenses
22:51:19.024 (24536000)|VF_DESERIALIZE_VIEWSTATE_BEGIN|066E0000000zLtC
22:51:19.028 (28042000)|VF_DESERIALIZE_VIEWSTATE_END
22:51:19.035 (35355000)|CODE_UNIT_STARTED|[EXTERNAL]|VF Controller Save
22:51:19.035 (35376000)|SYSTEM_MODE_ENTER|false
22:51:19.238 (238056000)|CODE_UNIT_FINISHED|VF Controller Save
22:51:19.238 (238122000)|VF_APEX_CALL|j_id4|{!save}|PageReference:/a0BE0000003I1C0
22:51:19.829 (241224000)|CUMULATIVE_LIMIT_USAGE
22:51:19.829|CUMULATIVE_LIMIT_USAGE_END

22:51:19.241 (241249000)|CODE_UNIT_FINISHED|VF: /apex/sample123__Expenses
22:51:19.241 (241258000)|EXECUTION_FINISHED

 

All Answers

SFDC-SDSFDC-SD

Post your controller too...

Rakesh ERakesh E

 

sorry , here iam using standard controller of todoitem__c object

SFDC-SDSFDC-SD

My bad... didn't see the post fully....

 

 

<apex:page standardController="Payment__c" tabStyle="Payment__c" >

<apex:form>
<apex:pageBlock title="Expense Record ">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Expense Details" columns="2">
<apex:inputField value="{!Payment__c.Amount__c}"/>
<apex:inputField value="{!Payment__c.Date__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

SFDC-SDSFDC-SD

if you still don't see the values, check the debug logs...

25.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
22:51:19.024 (24165000)|EXECUTION_STARTED
22:51:19.024 (24228000)|CODE_UNIT_STARTED|[EXTERNAL]|066E0000000zLtC|VF: /apex/sample123__Expenses
22:51:19.024 (24536000)|VF_DESERIALIZE_VIEWSTATE_BEGIN|066E0000000zLtC
22:51:19.028 (28042000)|VF_DESERIALIZE_VIEWSTATE_END
22:51:19.035 (35355000)|CODE_UNIT_STARTED|[EXTERNAL]|VF Controller Save
22:51:19.035 (35376000)|SYSTEM_MODE_ENTER|false
22:51:19.238 (238056000)|CODE_UNIT_FINISHED|VF Controller Save
22:51:19.238 (238122000)|VF_APEX_CALL|j_id4|{!save}|PageReference:/a0BE0000003I1C0
22:51:19.829 (241224000)|CUMULATIVE_LIMIT_USAGE
22:51:19.829|CUMULATIVE_LIMIT_USAGE_END

22:51:19.241 (241249000)|CODE_UNIT_FINISHED|VF: /apex/sample123__Expenses
22:51:19.241 (241258000)|EXECUTION_FINISHED

 

This was selected as the best answer
Rakesh ERakesh E

 thank you its working


SFDC-SD wrote:

if you still don't see the values, check the debug logs...

25.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
22:51:19.024 (24165000)|EXECUTION_STARTED
22:51:19.024 (24228000)|CODE_UNIT_STARTED|[EXTERNAL]|066E0000000zLtC|VF: /apex/sample123__Expenses
22:51:19.024 (24536000)|VF_DESERIALIZE_VIEWSTATE_BEGIN|066E0000000zLtC
22:51:19.028 (28042000)|VF_DESERIALIZE_VIEWSTATE_END
22:51:19.035 (35355000)|CODE_UNIT_STARTED|[EXTERNAL]|VF Controller Save
22:51:19.035 (35376000)|SYSTEM_MODE_ENTER|false
22:51:19.238 (238056000)|CODE_UNIT_FINISHED|VF Controller Save
22:51:19.238 (238122000)|VF_APEX_CALL|j_id4|{!save}|PageReference:/a0BE0000003I1C0
22:51:19.829 (241224000)|CUMULATIVE_LIMIT_USAGE
22:51:19.829|CUMULATIVE_LIMIT_USAGE_END

22:51:19.241 (241249000)|CODE_UNIT_FINISHED|VF: /apex/sample123__Expenses
22:51:19.241 (241258000)|EXECUTION_FINISHED