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

    What is Salesforce Marketing Cloud Email Studio in 2024?

    Blog in Others

    In the ever-evolving landscape of digital marketing, personalized communication is the key to capturing the audience’s attention. Salesforce Marketing Cloud Email Studio stands at the…

    Australia, Best Practices, Consistent Branding, Conversions, Data-Driven Decision-Making
    Kizzy Consulting May 7, 2024
    984  Views
    Salesforce Flows

    Search Account Record Using Salesforce Flows | Learn Here

    Blog in Salesforce

    Go to Setup, enter flow in Quick Find then select Flows.  Click on New Flow. From the template, select Screen Flow.  If you are using…

    API Name, Custom Label, Error Message, First Record, Flow
    Aryan Ujlayan May 27, 2022
    5,451  Views
    Why Salesforce Certification Matters?

    Why Salesforce certification matters?

    Blog in Coding and Scripting, Salesforce Certifications

    Why Certification Matters? According to the projections made by IDC, the Salesforce platform-based technology will have a huge impact of $859 billion on a global…

    Certification Trailblazer, Certified Advanced Administrator, Certified Platform Developer 1, Certified Platform Developer 2, Certified Sales Cloud Consultant
    Guha Feb 1, 2018
    4,836  Views

    Popular Salesforce Videos

    What's Up with What'sApp? |  Explained by Salesforce

    What's Up with What'sApp? | Explained by Salesforce

    Video in Others, Salesforce Stories

    With over 2 billion users, WhatsApp is the world’s most popular messaging app. WhatsApp channels are supported by Digital Engagement for Service Cloud. You can…

    salesforce, Salesforce Video, Service Cloud, Customers, Salesforce Learning
    Neha Yadav Jun 17, 2020
    3,329  Views
    Salesforce Marketing Cloud Automation Studio

    Salesforce Marketing Cloud Automation Studio

    Video in Marketing, Salesforce Cloud Platform

    Automation Studio is a Marketing Cloud application used to execute multi-step marketing and data management activities on an immediate, triggered, or scheduled basis. Use Automation…

    Salesforce Training, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning, Marketing
    Neha Yadav Aug 7, 2020
    2,510  Views
    What is a Salesforce Architect?

    What is a Salesforce Architect?

    Video in Salesforce Training

    If you are not familiar with the ‘Solution Architect’ role then it can be explained relatively simply. Solution Architects are ultimately responsible for the ‘Solution’…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Algoworks Apr 29, 2021
    1,382  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.