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

    How Virtual Salesforce Administrators Help with Automation

    Blog in Salesforce Admin

    Robotic Process Automation (RPA) for Salesforce is a tool that allows you to automate certain tasks. This virtual Salesforce administrator can be helpful if you…

    Automatable Tasks, Automate Tasks, Automation, Automation Tools and Integrations, Business Applications
    Apphienz Sep 20, 2022
    1,571  Views

    What Does a Salesforce Developer Course Include?

    Blog in Salesforce Training

    Since its inception, Salesforce has been the most renowned CRM platform provider in the world. This is due to the robust nature of an ecosystem…

    Apex Programming, Apex Triggers, App Deployment, Aura Components, Certification Guide
    Ray brad Aug 14, 2024
    694  Views

    Using Salesforce Commerce Cloud for an Online Retail Business

    Blog in Salesforce Cloud Platform

    The e-commerce platform has completely transformed the way of shopping for people. What could be better than being able to scroll through the varieties and…

    Artificial Intelligence, Business Workflows, Certified Experts Salesforce Product, Commerce, Commerce Cloud
    360 Degree Mar 14, 2022
    2,478  Views

    Popular Salesforce Videos

    All About Public Group in Salesforce

    All About Public Group in Salesforce

    Video in Others, Salesforce Apex

    Public Group represents a custom group of users defined by an administrator. Users can be added to a public group individually, or based on their…

    Salesforce Training, salesforce, Salesforce Video, Salesforce Learning, Administrator
    Prafull Jan 27, 2021
    1,871  Views
    Salesforce Pardot Basics - A Comprehensive Guide (2021)

    Salesforce Pardot Basics - A Comprehensive Guide (2021)

    Video in Marketing

    In this short video, we will cover the basics of Salesforce Pardot Pardot by Salesforce is a demand generation and marketing management tool by Salesforce.…

    Salesforce Training, Marketing Automation, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning
    SP Jun 21, 2021
    1,715  Views
    Salesforce Platform Quick Tip: How to Optimize UI for Mobile Users

    Salesforce Platform Quick Tip: How to Optimize UI for Mobile Users

    Video in Salesforce Stories, Mobile

    How do you design Salesforce for use on either a desktop monitor or a phone? What looks great on a big monitor looks crowded on…

    Salesforce Training, Salesforce Lightning, salesforce, salesforce platform, UI
    Abhishek Oct 7, 2021
    1,483  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.