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

    Popular Salesforce Blogs

    data mapping and merge mapping

    Data Mapping and Merge Mapping in Salesforce - Everything you Need to Know

    Blog in Others, Salesforce

    Adobe Sign is the high rated eSign tool which is provided by Salesforce AppExchange for the Adobe Document Cloud eSign facilities. It has tightly integrated…

    Apex Trigger in Salesforce, Business Process, Data Mapping, Data Mappings Tab in Salesforce, Developer Guide
    Aditya Apr 27, 2020
    11,648  Views

    Top 5 AI Use Cases in Marketing For Enhanced Retention | Salesforce Marketing

    Blog in AI and ML, Salesforce Einstein

    Artificial Intelligence (AI) is no longer prohibitively new or complicated for any company to implement. Businesses are utilizing AI in marketing, among other things, to make customer involvement more focused, personalized,…

    Artificial Intelligence, Audience Demographics, Businesses, Campaign, Content Marketing
    Apphienz Mar 7, 2022
    2,397  Views

    Salesforce Announces: Einstein GPT integration with Flow Data Cloud

    Blog in Salesforce integration

    We are thrilled to bring you the latest news in the world of B. In a groundbreaking move, Salesforce has announced the integration of Einstein…

    Artificial Intelligence, Business Planning, Business Workflows, Cloud Analogy, Competitive Advantage
    Chris Aug 18, 2023
    1,874  Views

    Popular Salesforce Videos

    Learn Apex Triggers Part 1 in Salesforce Development

    Learn Apex Triggers Part 1 in Salesforce Development

    Video in Salesforce Apex, Salesforce Training

    In this video, you will be learning about Apex Triggers in Salesforce Development: We will be discussing the following things in this video: 1. What…

    Salesforce Development, Salesforce Apex, Apex Class, salesforce, Salesforce Video
    Pooja Apr 22, 2020
    1,908  Views
    Salesforce Consultant Career | Salesforce Career Path | Salesforce Consultant Certification

    Salesforce Consultant Career | Salesforce Career Path | Salesforce Consultant Certification

    Video in Salesforce Certifications, Salesforce Consultant

    If you're interested in becoming a Salesforce consultant, one of the first things to consider is how much education you need. We've determined that 60.2%…

    Salesforce Training, Salesforce Certification, salesforce consultants, Salesforce Video, Salesforce Learning
    Rupal Kakkar Jan 5, 2021
    1,479  Views
    Write Tableau CRM Data to Salesforce Objects

    Write Tableau CRM Data to Salesforce Objects

    Video in Others, Salesforce Stories, Data

    Use Tableau to blend Salesforce data from across the Customer 360 platform with your other business data for increased visibility and a deeper understanding of…

    Salesforce Training, Salesforce Tutorial, Salesforce Objects, Salesforce Data, Salesforce Video
    Rupal Kakkar Jan 8, 2021
    2,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

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