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

    Benefits of Salesforce Einstein Analytics For Nonprofits

    Blog in Salesforce Einstein

    Sometimes it gets challenging for your nonprofit organization on how your campaigns are performing, the impact you are creating, and the funds getting generated for…

    Benefits of Einstein, Boosting Team Collaboration, Business Intelligence Tools, Business Model, Campaign
    Apphienz Apr 14, 2022
    2,259  Views

    Dreamforce 2024: Spectacular Event With P!NK & Imagine Dragons Promoting Innovation, Networking, and Dreamfest

    Blog in Salesforce integration

    Dreamforce 2024 promises to be the most innovative technology event of the year, fusing innovative technology with smart business tactics and jaw-dropping entertainment. This year's…

    Business Automation, Business Growth, Business Networking, Business Strategy, Cloud Computing
    AwsQuality Sep 16, 2024
    734  Views

    Webinar: Performing a Successful Technical Debt Assessment in Salesforce

    Blog in Salesforce

    Technical debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy (and potentially limited) solution…

    Business Changes, Business Grows, Financial Debt, Implement, Implement Changes
    Vala Marcou Nov 27, 2020
    1,874  Views

    Popular Salesforce Videos

    The Future of Salesforce App Dev with Parker Harris & Friends

    The Future of Salesforce App Dev with Parker Harris & Friends

    Video in Trailhead

    Join Parker Harris, Salesforce product managers, and engineers as we kick off Day 2 of TrailheaDX with an in-depth look at exciting new features coming…

    Salesforce Developer, Salesforce Einstein, Salesforce CRM, Salesforce Tools, Salesforce Automation
    Prafull Apr 5, 2018
    2,474  Views
    Getting started with Salesforce integration patterns using MuleSoft

    Getting started with Salesforce integration patterns using MuleSoft

    Video in Salesforce Integration

    Learn how to develop different integration patterns between Salesforce and external systems. You can read the full tutorial, and download the project jar file by…

    Salesforce Training, Salesforce Integration, Salesforce Video, #integration, Salesforce Learning
    Neha Yadav Jul 31, 2020
    2,398  Views
    Good Time To Buy Salesforce Stock? CRM Stock Analysis

    Good Time To Buy Salesforce Stock? CRM Stock Analysis

    Video in Others, Salesforce Stories

    CRM stock price is currently all over after reporting its SALESFORCE earnings report. I am considering if I should buy CRM Stock. This is a…

    salesforce knowledge, Salesforce Learning, Salesforce Stock, Salesforce Earnings Report, CRM Stock Analysis
    Neha Yadav Sep 2, 2020
    2,165  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.