The steps below are for adding Order Products to existing Orders in Salesforce.
ID - Optional for update or upsert, specify the existing Product Order record Ids for update. If an Id is not set for a row in your file, an upsert with Data Loader will create a new Order Product for that row.
ORDERID - record Id for the Order you're adding products to. If adding multiple Products to the same Order create an individual row for each unique Product to be added. Use Data Loader to Export Data by checking 'Show all Salesforce objects' and choosing the 'Order (Order)' object to create a list of existing Order Ids.
Sample export query: SELECT Id, OrderNumber, OwnerId, Owner.Name, AccountId, Account.Name, Pricebook2Id, Pricebook2.Name FROM Order WHERE Status = 'Draft'
Note: The query above only returns draft orders since it's not possible to add or modify products for activated orders. It is possible to change activated orders back to draft by updating the Order object's 'Status' field from a value of 'Activated' to 'Draft' via the Data Loader. See Insert, Update, or Delete Data Using Data Loader and the Order | SOAP API Developer Guide documentation for more details.
PRICEBOOKENTRYID - The record Id Product's entry in the Price Book that's associated to the Order. Use Data Loader to Export Data from the Price Book Entry (PriceBookEntry) object to generate a list of record Ids.
Sample export query: Select Name, Id, UnitPrice, Pricebook2.Name, Pricebook2Id, Product2.Name, Product2Id FROM PricebookEntry WHERE IsActive = true
QUANTITY - Required, initial or the updated number of products.
UNITPRICE - Required, unit price for the order product.
SERVICEDATE - The Start Date for the order product. For acceptable values see the 'Date Formats' section of the Data Types Supported by Data Loader for more details.
Note: You may need to add additional fields depending on your org's unique customizations such as validation rules or required fields on the Order Product object. Refer to the OrderItem documentation for standard fields.
1. Populate the corresponding Order Ids for which you would like to add or update Products into the ORDERID column.
2. Populate PricebookEntry Ids and Unit Price values into your file.
3. Populate the Quantity you wish to have for your line items.
4. Put the Service Dates in with the appropriate Line Items or Orders. (Dependent on your Business Logic this is Org and company specific)
5. (Optional for upsert) populate existing Order Product (line item) record Ids.
6. (Optional for upsert) edit the Service Date or Quantity for the established Line Items. If you do not make changes to the line item you will receive Errors in Data Loader. If you are not making changes to the line items, you can remove or exclude them from the CSV.
1. Check the box for 'Show all Salesforce objects'
2. Select "Order Product (OrderItem)"
3. Choose the CSV you created and Next.
4. Hit next again (For Upsert, map the Id column from the CSV as the default Matching Field for Data Loader Step 2a).
5. Create a Mapping, Auto-Match Fields to Columns, click OK, and click Next.
6. Click the Browse... button to select the directory where the success and error files should be saved, then click "Finish".
7. When a pop appears asking you to proceed, click Yes.
Data Loader Overview
Orders Overview
Preparing Your Data for Import
Prepare a CSV file for an import or update in Salesforce
000384893

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.