• Suresh Thakkar
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
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>
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>

Hello,

 

Here is my goal:  I want to be able to display an alert to users the first time they see specific records (cases in this instance).  What I am intending to do is on page load see if the case meets the primary criteria and also make sure that their user ID does not appear in a hidden field.  Then, if the above is true, the message will be displayed and then their user ID added to the hidden field and the record saved.  I want to avoid using customer controllers if possible, but if its necessary I will do it.  

 

The message is popping up fine but for some reason the record is either not being saved, or the field is not being updated before the save.

 

<apex:page standardController="Case" rendered="{!NOT(ISBLANK(Case.Pilot_Participation__c))}" id="thePage">
<apex:form rendered="{!NOT(CONTAINS(case.zTEST__c, LEFT($User.Id, 15)))}">
    <apex:actionFunction name="autosave" action="{!save}" id="autosave" >
        <apex:param assignTo="{!case.zTEST__C}" value="{!case.zTEST__c + ', ' + $User.Id}" name="testUpdate" id="testUpdate" />
    </apex:actionFunction>    
    <script type="text/javascript">
        {
            window.alert("Hello World!");                      
        }
    </script>
    <script>          
          function callAutoSave()
          {              
              autosave();
          }    
    </script>
    </apex:form>
</apex:page>

 

 

Here is what I have, please let me know how to change it (can I just assign the parameter in the java before I call the save function?

 

 

 

 

Thanks,
Jeremy Stender