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

    Use of Business Unit in Salesforce Marketing Cloud

    Use of Business unit in Salesforce Marketing cloud

    Blog in Salesforce Cloud Platform

    Use of Business unit in Marketing cloud Business unit - By using Business unit we can give the Access of users According to our requirements…

    Business Unit, Business Unit in Marketing Cloud, Salesforce Marketing Cloud
    Rajan Mar 17, 2018
    10,638  Views
    Salesforce-Powered Communities

    Employee Onboarding Made Easy With Walk-Throughs on Salesforce-Powered Communities

    Blog in Salesforce

    We are currently in the midst of a learning revolution. Technology has given us the tools to build learning programs that meet individual learners where…

    Application, Businesses, Career Development, Career Needs, Change Management
    Grazitti Jun 3, 2022
    2,566  Views

    Provide the right solution | Salesforce & Tableau Integration

    Blog in Others

    Imagine having an advantage that lets you understand your customers better than ever before. That's exactly what happens when you combine the might of Salesforce…

    Integration, right solution, Salesforce, Tableau
    Cloudy Aug 1, 2025
    200  Views

    Popular Salesforce Videos

    Solving the Fizz Buzz (AMPscript) in Salesforce Marketing Cloud

    Solving the Fizz Buzz (AMPscript) in Salesforce Marketing Cloud

    Video in Marketing, Salesforce Cloud Platform, Salesforce Training

    Cameron Robert from Datarati uses 2 different approaches to solve the Fizz Buzz programming challenge using AMPScript Salesforce Marketing Cloud. What you'll learn: » How…

    Salesforce Tutorial, salesforce, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning
    Cameron Sep 5, 2025
    1,322  Views
    How does Salesforce Field Service Platform increase servicing revenue for your company

    How does Salesforce Field Service Platform increase servicing revenue for your company

    Video in Salesforce Field Service Platform

    CRM Salesforce, along with its Field Service Lightning App, is drastically improving the field-force productivity in the industry. Built on the Salesforce Service Cloud, it…

    Salesforce Service Cloud, Salesforce CRM, How To Learn Salesforce Lightning, Salesforce Service Cloud Tutorial, Salesforce Service Cloud Training Video
    AllianceTek Jan 23, 2019
    2,192  Views
    Marc Benioff on How Salesforce Was Able To "do well and do good"

    Marc Benioff on How Salesforce Was Able To "do well and do good"

    Video in Salesforce Stories

    Billionaire Marc Benioff is considered a game-changer for activism in the business world. Benioff is the co-CEO, chairman, and co-founder of the cloud computing company…

    salesforce, Cloud Computing, Salesforce Learning, Salesforce CEO, Marc Benioff
    Pooja Aug 13, 2020
    2,004  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®.

    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.