Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • 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
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • 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
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How can we insert multiple sObjects in a single DML operation?

    Tagged: Account List in Salesforce, Child Record, DML Operation, DML Operations, Insert, insert Object, Parent Child Record, Parent Record, Salesforce Account, Salesforce Contacts, Salesforce Objects, sObject

    • Salesforce® Discussions

      How can we insert multiple sObjects in a single DML operation?

      Posted by Subhendu on January 15, 2018 at 6:26 AM

      How can we insert multiple sObjects in a single DML operation? What are the limitations that should be considered while doing that?

      Ajay Prakash replied 8 years, 3 months ago 2 Members · 1 Reply
      • Account List in Salesforce
      • Child Record
      • DML Operation
      • DML Operations
      • Insert
      • insert Object
      • Parent Child Record
      • Parent Record
      • Salesforce Account
      • Salesforce Contacts
      • Salesforce Objects
      • sObject
    • 1 Reply
    • Ajay Prakash

      Member
      January 15, 2018 at 6:59 AM

      Hi Subhendu,

      Yes, you can insert multiple sObjects in single DML Operation. Refer below code -

      list<sobject> sObjList = new list<sObject>();
      Account acc = new Account(name='testAcc');
      Contact con = new Contact(lastName ='TestCon');
      sObjList.add(acc);
      sObjList.add(con);
      insert sObjList;

      You can not insert parent and child record both in single DML statement. Ex. In the above sample code, you can not associate a contact with the account being inserted in the same transaction.

       

    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

    [adinserter block="12"]

    Popular Salesforce Blogs

    Salesforce Implementation

    Salesforce Implementation Checklist: 9 Steps to Success

    Blog in Salesforce Implementation

    Through it all, Salesforce continues to remain one of the largest players and one of the best platforms in the market. But we all know…

    Best Implementation, Best Salesforce Implementation, Business, Business Needs, Company
    DB Nov 16, 2021
    4,689  Views
    Leveraging Salesforce’s Complimentary Data Cloud and Tableau Licenses

    Leveraging Salesforce’s Complimentary Data Cloud and Tableau Licenses

    Blog in Salesforce Products

    In the ever-evolving landscape of business, access to valuable data insights and powerful analytics tools is essential for sustainable growth. Salesforce, a leader in customer…

    Business Insights, Competitive Advantage, Complimentary, Cost Efficiency, CRM Solutions
    Kizzy Consulting Apr 11, 2024
    797  Views
    Business Process in Salesforce

    Learn About the Business Process in Salesforce

    Blog in Salesforce Admin

    A business process in Salesforce allows Admins to set up dedicated leads, sales, and support processes for each line of business of an organization. This…

    Business Process, Business Process for Opportunities, Business Process in Salesforce, Case Object, Case Resolutions
    Anshu Feb 23, 2022
    4,625  Views

    Popular Salesforce Videos

    Implement Time Based Workflow | Salesforce Tutorial

    Implement Time Based Workflow | Salesforce Tutorial

    Video in Others, Salesforce Training

    If you ask any Salesforce Person, which kind of workflow is difficult to understand and implement, the obvious answer will be the Time Based on…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Sam J Oct 12, 2020
    1,857  Views
    Salesforce Winter 21 Release - Sneak Peek

    Salesforce Winter 21 Release - Sneak Peek

    Video in Salesforce Stories

    The Winter ’21 release delivers innovations across the Salesforce Customer 360 platform to help connect you to your customers, from anywhere. Fancy table updates, live…

    Salesforce Video, Salesforce Customers, Salesforce Release Notes, Salesforce Winter 21 Release, Winter 21
    Rupal Kakkar Aug 26, 2020
    1,787  Views
    Copy to Clipboard Functionality in Salesforce - Lightning Component Projects Series Part 2

    Copy to Clipboard Functionality in Salesforce - Lightning Component Projects Series Part 2

    Video in Lightning, Salesforce Training

    In this video, I'm creating a lightning component Project for functionality i.e Copy to Clipboard. Watch this video and learn. If you have any doubts…

    Salesforce Training, Salesforce Lightning, Salesforce Video, Salesforce Learning, Lightning Component
    Shubham Feb 23, 2021
    2,824  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.