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
dotnet developedotnet develope 

new record is not adding through force.com site.

Hi all,

 

 

I have create a force.com site in my developer instance and i have created a page assign as Active Site Home Page.

 

When i am browsing the site it is displaying the site. But when am click on save button it is not saving the new record.

 

Then i have given static values eventhough its not working.

 

can anyonce help me please.

 

Apex Cde:-

<apex:page controller="insertauto" showHeader="false"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" rerender="error"/> </apex:pageBlockButtons> <apex:pageBlockSection title="info" columns="1"> Name<apex:inputText value="{!autoname}"/> Manufacture <apex:inputText value="{!manufacture}"/> msg <apex:inputText value="{!msg}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

Controller Class:

 

public with sharing class insertauto { public Automobile__c accts = new Automobile__c(); public String autoname {get; set;} public String manufacture {get; set;} public String msg{get; set;} public insertauto(){ } public void save(){ accts.Name='mahesh'; accts.Manufacture_Name__c='maruthi'; insert accts; } }