How to Import Order Products with Data Loader in Salesforce

In Salesforce, the order product object represents an original product on an order. It can also represent a charge, such as a delivery charge. We can add products to an order manually via the Salesforce user interface. The Salesforce Data Loader can be used to import and insert a number of Order Products (OrderItems).

In this Salesforce tutorial, we will learn to import order products with data loader in Salesforce. In this process, we will add Order Products to existing Orders in Salesforce.

Import Order Products with Data Loader in Salesforce

To import Order Products with the data loader in Salesforce, there are the following considerations that we should be aware of.

  • The products you will import in Orders must be assigned to a Price Book.
  • The Currency code, products, Contracts, and Orders should be familiar.
  • OrderItems are associated with Products via PricebookEntry records, so ensure the Pricebook has products in it.
  •  We can only add Order Items or Products via PricebookEntry records for the Pricebook that’s assigned to the Order.
  • It’s not possible to add Products to activated Orders. We can only import Order products for draft Orders.

Create a CSV file to import order products with the data loader in Salesforce

We first must create a CSV file with the following header columns to import order products with the data loader.

  • 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. To get the OrderID, run an export from the data loader for the Order object.
  • PRICEBOKID – The record ID of the product’s entry is in the Price Book associated with the Order. To get this, run a data export for the PriceBookEntry object to generate a list of record IDs.
  • QUANTITY – Enter the number of products.
  • UNITPRICE – Enter the Unit price of the Order Product.
  • SERVICEDATE — Enter the Start Date for the order product, which should not be less than the start date of the order contract. The data must be entered in the date format in your org.

The image below refers to the CSV file I created to import order products with the data loader in Salesforce.

Insert order in Salesforce Products via data loader

Insert Order products from CSV file with the Data loader

To insert the order products with data loaded from the CSV file we created in the above steps, open the data loader and follow the steps below.

1. Login with your crededntials in the data loader and click on the Insert button or click Upsert if you want to import new records and update the existing one.

Import Order products in Salesforce via data loader

2. In this step, activate the Show All Salesforce objects checkbox and select the Order Product (OrderItem) data object.

After this, browse the created CSV file and click on the Next button.

Salesforce Order Products import via data loader

3. As we click on the Next button, the data loader will initialize the uploaded CSV file and here click on the OK button to proceed.

4. In this step, we will map the data object fields with the header columns, and for that, click on the Create or Edit a Map button. Then, in the Mapping dialog window, click on Auto-Match fields and columns.

If the columns are not auto-matched with the object field name, then you have to drag the object fields down to the column mapping.

After mapping, click on the OK button and the Next button.

Use data loader to import order products in Salesforce

5. Select the location for the error and success files from which they can be accessed later.

At last, click on the Finish button.

Insert order products via Salesforce data loader

6. In the warning message of data operation, click on the Yes button to proceed.

7. Now the data loader will start the data insertion, and after its completion, a dialog box will display the number ok successes and errors that occurred during the data insertion.

Click on the OK button to close the Data Loader wizard.

Insert Products in Salesforce Orders via data loader

8. Now, to view the imported products in the order, open the Salesforce developer console and navigate to the Orders tab from the app launcher, then open the orders record in which you have imported products.

In the Order record, go to the section Order Products and there you will see the products that we have imported in the order using the Salesforce data loader.

Use data loader to import products to orders in Salesforce

In this way, we can import order products with a Data loader in Salesforce by following the above steps.

Conclusion

In Salesforce, products can be assigned manually but when it is required to assign mass products to the draft orders, then using the data loader is the go-to solution for that.

In this Salesforce tutorial, we have learned about the process of Importing order Products with the data loader, and by following the above steps, you can manage order products in your Salesforce instance.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.