Toggle Side Panel

  • Blogs
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How Can I Insert, Update the Account Records from Salesforce Vf page using Remote actions?

    Tagged: Account Record, Javascript Remoting, Remote Action, Salesforce Visualforce Page

    • Salesforce® Discussions

      How Can I Insert, Update the Account Records from Salesforce Vf page using Remote actions?

      Posted by Manu on December 13, 2018 at 2:20 PM

      How Can I Insert, Update the Account Records(using custom controller class) from Vf page using Remote actions?

      Thanks in advance

      Jade replied 7 years, 9 months ago 2 Members · 1 Reply
      • Account Record
      • Javascript Remoting
      • Remote Action
      • Salesforce Visualforce Page
    • 1 Reply
    • Jade

      Member
      January 11, 2019 at 7:48 AM

      Hi Mallesh,

      Definitely you can Update and Insert Account or any object Record using JavaScript Remoting.

      check the below code:

      //This is a javaScript Remoting function, you can use it to update/Insert Account
      <script type="text/javascript">
      function getRemoteAccount() {
          var account = {!accRec}; //Initialize an account in your controller like, Account accRec{get;set;}
          //Then set the values of this from your page
          Visualforce.remoting.Manager.invokeAction(
              '{!$RemoteAction.MyController.updateAccount}', 
              accRec, 
              function(result, event){
                  if (event.status) {
                      //Even account get updated, you will get the values in "result"
                  } else if (event.type === 'exception') {
                      document.getElementById("responseErrors").innerHTML = event.message;
                  } else {
                      document.getElementById("responseErrors").innerHTML = event.message;
                  }
              }, 
              {escape: true}
          );
      }
      </script>
      
      Apex:
      
      In apex you can have this method.
      
      @RemoteAction
      Public Static void updateAccount(Account acc){
          if(acc != null){
             try{
                 update acc;
             }catch(DMLException de){
                 System.debug('DML Exception');
             }
          }
      }
      
      Hope this will be helpful!!!
      
      Thanks

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    Popular Salesforce Blogs

    Salesforce Implementation Costs: Factors to Consider and Average Expenses

    Blog in Salesforce Implementation

    According to the Total Cost of Ownership of Salesforce study, there are a few main factors regarding CRM adoption decisions.  The financial sting of ongoing costs…

    AppExchange, Business Needs, Case Study, CRM Adoption, Customization
    Twistellar Apr 4, 2024
    2,449  Views

    Top Sales Cloud Features From The Salesforce Winter '22 Release

    Blog in Salesforce Einstein, Salesforce Releases

    With each release, Salesforce products become more user-friendly. Salesforce Sales Cloud is already the best sales CRM in the world but this new Salesforce Winter…

    Best Practices, Call Script, Contiguous Territories, Conversation Data, Custom Solutions
    Apphienz Jan 4, 2022
    4,348  Views
    Setting SSO Between Salesforce and Okta’s Salesforce.com Standard Application using SAML 2.0 protocol

    Setting SSO Between Salesforce and Okta’s Salesforce.com Standard Application using SAML 2.0 protocol

    Blog in Others

    SSO(Single Sign On between Okta(Salesforce.com application) as Identity Provider and Salesforce as Service Provider) Steps to setup SSO between Salesforce and Okta’s Salesforce.com Application:- Go…

    Assignment Tab, Configuration, Dashboards, Identity Provider, Login URL
    shariq Sep 10, 2018
    11,808  Views

    Popular Salesforce Videos

    How to Report on the Reports in Your Salesforce Org

    How to Report on the Reports in Your Salesforce Org

    Video in Others, Salesforce Training

    Do you want a list of all the reports in your Salesforce org? Would you like to see a list of reports and the last…

    Salesforce Training, Salesforce Tutorial, Salesforce Reports, Salesforce Org, Salesforce Video
    Rupal Kakkar Mar 25, 2021
    2,181  Views
    Discount Categories in Salesforce CPQ

    Discount Categories in Salesforce CPQ

    Video in Salesforce Training

    Use the discount category object to store values that you want to apply via rules to one or more products. After you associate the discount…

    Salesforce Training, Salesforce CPQ, Salesforce Video, Salesforce Learning, Product Rule
    Rupal Kakkar Jun 14, 2021
    2,908  Views
    DreamTX Welcome Day 2 | Dreamforce 2020 | Salesforce

    DreamTX Welcome Day 2 | Dreamforce 2020 | Salesforce

    Video in Salesforce Stories, Events

    If you missed DreamTX DAY 2, then live this amazing experience here, we have covered it all for you. See the power of Customer 360,…

    dreamforce, salesforce, Salesforce Event, Salesforce Video, Customer 360
    Pooja Dec 16, 2020
    2,340  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.