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 we cancel or save account field in the account object in Salesforce org by javascript?

    Tagged: Account, Javascript, Salesforce Org

    • Salesforce® Discussions

      How can we cancel or save account field in the account object in Salesforce org by javascript?

      Posted by Mohit on July 19, 2016 at 3:49 PM

      Hi all,

      How can we cancel or save account field in the account object in salesforce org by javascript?

      If we ask the user that user want to insert account field on the account or cancel the insertion of account field on an account by the help of Javascript. By using Javascript confirm function that user wants to insert the account detail or want to cancel the insertion of account details.

      Please give your suggestions.

      Prakhar replied 10 years, 3 months ago 2 Members · 1 Reply
      • Account
      • Javascript
      • Salesforce Org
    • 1 Reply
    • Prakhar

      Member
      July 20, 2016 at 11:19 AM

      Hii Pranav,

      You can do DML operation with the help of Javascript by using sforce.connection.

      Here is an simple example to insert the record in account object in salesforce:-

      var account = new sforce.SObject('Account');

      // Provide the required fields for the account to insert and other fields that you want.

      account.Name = 'Test';

      // Here you can provide your condition for the insertion or cancel the record.

      if(account.Phone != ' ' && account.Phone != Null){
      var results = sforce.connection.create([account]);

      }

      else{

      //Show some error .

      }

      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

    Sharing Rules in Salesforce

    Overview of Sharing Rules in Salesforce | Salesforce Security Guide

    Blog in Salesforce Admin, Salesforce Apex

    Hey, have you ever wondered how one can make some restrictions in the profile so that it won’t affect the other user, their privacy within…

    Assets, Auto Number, Campaigns, Cases, Contacts
    Akash Varshney Oct 28, 2022
    2,838  Views
    Lightning-record-form

    Learn About Lightning-record-form Component in Salesforce

    Blog in Lightning

    recordForm With the lightning-record-form component, forms to add, view, or update records may be made quickly.  Creating record forms with this component is simpler than…

    API Developer Guide, API Name, Component, Contact and Account Objects, Contact Object
    NAVDITA DAHIYA Nov 17, 2022
    3,147  Views

    Simplifying Complex Data Models in Salesforce – Introducing iSyncSF

    Blog in Salesforce

    Are you tired of dealing with intricate data models in Salesforce? Do you find it challenging to manage various object relationships efficiently? Look no further!…

    Automate Processes, Automated Features, Automated Object Relationships, Automated Platform, Automated Processes
    H2TECH Jul 13, 2023
    1,609  Views

    Popular Salesforce Videos

    Salesforce Field Service: Complex Work and Routing | AblyPro Webinar

    Salesforce Field Service: Complex Work and Routing | AblyPro Webinar

    Video in Salesforce Field Service Platform

    Salesforce Field Service is a powerful tool designed to help businesses manage complex field service workflows and optimize their routing processes. With Salesforce Field Service,…

    salesforce, Routing in Salesforce, Salesforce Field Service, Salesforce Experts, Job
    AblyPro Oct 25, 2023
    1,044  Views
    Apex Scheduler in Salesforce | Asynchronous Apex

    Apex Scheduler in Salesforce | Asynchronous Apex

    Video in Salesforce Apex

    Asynchronous Apex 1. Apex Scheduler 2. Interfaces in Apex Scheduler 3. Making callout using Apex Scheduler 4. Points to Remember Upcoming Video on How to…

    Salesforce Training, Salesforce Tutorial, Salesforce Development, Salesforce Integration, salesforce
    kanika Jul 5, 2021
    3,273  Views
    How to Get Your Data In and Get Insights Out | Salesforce Essentials

    How to Get Your Data In and Get Insights Out | Salesforce Essentials

    Video in Data

    Organize all your data with Salesforce Essentials. With a quick and easy import, you’ll be able to manage your business and watch it grow. Essentials…

    Salesforce Training, Salesforce Data, Salesforce Video, Salesforce Essentials, Salesforce Learning
    Jogender Aug 10, 2020
    1,911  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.