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

    Salesforce Engage: Ideal Link Between Marketing and Sales

    Blog in Salesforce

    The cohesion between the marketing and sales teams is vital in the business world as it allows concerted efforts, speeding up sales cycles, and optimizing…

    Business World, Contact Record, Data-driven Decisions, Email Communications, Email Interactions
    SkyPlanner May 5, 2023
    1,346  Views

    Automate Salesforce Data Import/Export Using Data Loader CLI

    Blog in Others

    One of the key facets of Salesforce is import and export data from salesforce. Data loader is a great tool provided by Salesforce to achieve…

    Command-line Interface, CRM, Data Loader, Salesforce, Salesforce Data
    Ravi Aug 3, 2016
    69,818  Views
    What is the Grant Management System in Salesforce? All You Need to Know

    What is the Grant Management System in Salesforce? | All You Need to Know

    Blog in Others

    Grant Management in Salesforce is a component of the Nonprofit Success Package (NPSP). In this package, Salesforce will award her 10 free licenses to some…

    Applications, Customized Scholarship Portal, Funding Cycle, Funding Opportunities, Funding Requests
    NAVDITA DAHIYA Apr 3, 2023
    2,003  Views

    Popular Salesforce Videos

    Things You Must Know About Salesforce Desk.com

    Things You Must Know About Salesforce Desk.com

    Video in Salesforce Implementation

    Salesforce Desk.com is an all-in-one customer support application which is completely cloud based and which gives you the ability to buy services on per agent…

    Salesforce Integration, Salesforce Customization, Customer Success, Automate Business Processes, Salesforce App Development
    Algoworks Mar 27, 2018
    1,727  Views
    How Much Time to Give to Salesforce Preparation?

    How Much Time to Give to Salesforce Preparation?

    Video in Salesforce Training, Salesforce Admin

    Wondering how much time to give for Salesforce preparation? Watch this video it explains distinctly how much time you need to learn. If you have…

    Salesforce Training, Salesforce Tutorial, Salesforce Online Training, Salesforce Jobs, Salesforce Developer
    CRS Jun 13, 2022
    1,887  Views
    Salesforce - Sage ERP Integration

    Salesforce - Sage ERP Integration

    Video in Salesforce Integration

    Salesforce Integration with Sage ERP (SageX3 / Sage100 / Sage300) delivers seamless, real-time, bi-directional integration that plays a pivotal role in unlocking the potential of…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Video
    Greytrix Dec 28, 2020
    2,574  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.