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, 7 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

    third party app

    What is Third Party Integration in Salesforce in 2023?

    Blog in Others

    Why a Third-Party App? It is impossible to avoid using third-party integrations while using Salesforce B2C Commerce. How bad is that? No, it's incredible! It's…

    B2C Commerce Version, Bug Repairs, Cartridge, Checkout, Client Resources
    vishnu kumar May 8, 2023
    1,623  Views

    Maximize Your App's Reach: The Ultimate Guide to Listing on Salesforce App Exchange

    Blog in Salesforce Apex

    As you peruse this article on Forcetalks, we are confident that you possess an understanding of Salesforce App Exchange. However, are you aware that this…

    App listing, App Performance, App Store, AppExchange, Approval
    Algoworks Jul 21, 2023
    2,068  Views

    Important Strategies Lessons from Dreamforce 2024

    Blog in Salesforce Consultant

    Are you ready to discover how Salesforce's latest innovations at Dreamforce 2024 are reshaping the future of business? From cutting-edge AI integrations and the power…

    Business Growth, Business Strategy, Customer Engagement, Customer Experience, Data Cloud
    AwsQuality Sep 6, 2024
    698  Views

    Popular Salesforce Videos

    4 Benefits Of Customized Salesforce Services

    4 Benefits Of Customized Salesforce Services

    Video in Salesforce customization

    Salesforce is a fantastic CRM, but the truth is that the off-the-shelf version is nothing compared to the power of Salesforce once you customize it.…

    Salesforce Training, CRM, salesforce services, Salesforce Customization, Salesforce Video
    Cyntexa May 19, 2022
    1,365  Views
    Passed Salesforce Certification Exam in First Attempt

    Passed Salesforce Certification Exam in First Attempt

    Video in Salesforce Certifications, Salesforce Training

    Salesforce certifications come in all shapes and sizes, so nearly anyone who works in Salesforce and wants to learn more about the tool can find…

    Salesforce Training, Salesforce Certification, salesforce, salesforce platform, Salesforce Video
    Jogender Jun 19, 2020
    1,779  Views
    Is Salesforce Career Recession Proof?

    Is Salesforce Career Recession Proof?

    Video in Salesforce Development

    Is Salesforce Career Recession Proof? Watch this video and get all the knowledge about the Salesforce industry. Join this useful group for Salesforce job &…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, salesforce, Salesforce Data
    Intelogik Nov 4, 2022
    1,988  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.