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
Suresh ThakkarSuresh Thakkar 

How to update Custom Object Field using visual force page

Hello, I am trying to update custom object field using visualforce page without clicking "Save" button. Please could you let me know if this is possible. Basically I am implementing some functionality where mobile camera will open salesforce page. Anytime this page is open I would like to update Status field of custom object. Following code is working fine. In this case I have to click Save button. And I would like to avoid this Save button click. Please let me know if this is possible. 

<apex:page standardController="Seat__c" sidebar="false" showHeader="false" >
    <apex:form id="appForm">
    <apex:pageBlock title="Check-In Details" mode="save" id="Seatedit">
     <apex:pageBlockSection id="Seatdetail" columns="1" collapsible="true" >
        <apex:outputField value="{! Seat__c.First_Name__c }" />    
        <apex:outputField value="{! Seat__c.Last_Name__c }" />
        <apex:outputField value="{! Seat__c.Table_Number__c }" />
        <apex:inputField value="{! Seat__c.Status__c }" id="idstatus"/>
        
       <script type="text/javascript">
        document.getElementById('{!$component.appForm.Seatedit.Seatdetail.idstatus}').value='Attended';
        </script>
        <apex:commandButton action="{!save}" value="Check-In"/>
           </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Suresh ThakkarSuresh Thakkar
Please help to get this answer.