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

    application solution

    Popular Salesforce Blogs

    Salesforce & COVID-19

    Fight Against COVID-19: How is Salesforce Helping?

    Blog in Salesforce

    The world has seen various pandemics in the last century, such as influenza, H1N1, H2N2, H3N2, and many more. Though the world has fought them…

    AppExchange COVID19 Resource Center, Apple WWDC, Aruba Networks Atmosphere 2020, Atlassian Summit 2020, Black Hat Asia 2020
    Forcetalks Mar 30, 2020
    5,658  Views
    Aura Components in Salesforce

    Overview of Aura Components in Salesforce | The Developer Guide

    Blog in Salesforce Apex

    Aura The modular, reusable parts of an app are called aura components. From a single line of text to a whole app, they stand for…

    Application Events, AURA, Aura Components, Aura Interfaces, Aura:component Tag
    ashutosh pandey Oct 7, 2022
    4,539  Views

    Top Picks Service Cloud Features, Salesforce Winter '22 Release

    Blog in Salesforce, Salesforce Cloud Platform

    Every year Salesforce release features get bigger and better. This year is nothing short of new exciting features. Salesforce released its Winter ‘22 release features…

    Appointment Assistant, B2C Companies, Bot Analytics, Bot Experience, Bot Overview
    Apphienz Sep 21, 2021
    2,281  Views

    Popular Salesforce Videos

    How To Build Better Communities with Salesforce Lightning?

    How To Build Better Communities with Salesforce Lightning?

    Video in Lightning

    Learn how you can customize Salesforce Community Cloud to fit your needs with the Lightning Bolt framework, Lightning Components and Community Builder.

    Salesforce Online Training, Salesforce Developer, Salesforce Lightning Components, Salesforce Community, Salesforce Community Cloud
    Portia Feb 6, 2018
    1,711  Views
    Coronavirus Impact On Healthcare Sector – Time To Rejuvenate | Salesforce CRM

    Coronavirus Impact On Healthcare Sector – Time To Rejuvenate | Salesforce CRM

    Video in Salesforce Products

    The Covid 19 has created an economic recession in the healthcare industry with disruption in healthcare services. The global healthcare CRM market is likely to…

    Salesforce Training, Salesforce Service Cloud, Salesforce Consultant, Salesforce Marketing Cloud, Salesforce CRM
    Kcloud Dec 23, 2020
    1,716  Views
    Salesforce Billing - Digital Wallets and Alternative Payment Methods

    Salesforce Billing - Digital Wallets and Alternative Payment Methods

    Video in Others, Salesforce Stories

    THE GOAL:  In this video, you will learn how to use Alternative Payment Methods and Digital Wallets with Salesforce Billing. BEFORE YOU BEGIN, KNOW THE…

    salesforce, Salesforce Video, Salesforce Billing, Digital Wallets, Alternative Payment Methods
    Jogender Jul 1, 2020
    3,530  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

    © 2025 - 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®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.