Importing Products And Adding Them To Custom Price-Book In Salesforce Using Data Loader
Author: Rishabh Dubey
To mass Import product and adding them to Custom pricebook we will require an excel file in CSV format with below Columns
1. Product Name (Required)
2. Product Code (Optional)
3. Product Family (Optional)
4. Active (True for all Rows)
5. Description (Optional)
6. Price
7. Standard PriceBook ID
8. Custom Pricebook ID
The file will look as below
Step 1 : (Import Product)
a. Login to dataloader
b. Click Insert
c. Select object = Product(Product2)
d. Click on browse and select the CSV file you created for Import
e. Click on next
f. Click on Create or Edit a Map
g. Map the fields and columns as below
Active : IsActive
Description : Description
Product Code : Productcode
Product Family : Family
Product Name : Name
The mapping will look like as below
h. Click on Ok
i. Click on next
j. Select path to store success and error file
k. Click finish
Step 2 (Add products to Standard Price book)
Without adding products to the Standard pricebook we will not be able to add products to Custom pricebooks. If we try to add products to Custom pricebook without adding them to standard pricebook we will get error — “Before creating a custom price, create a standard price.”
a. Go to the path in your system where you have saved error and success file from step 1
b. Open the Success file
c. The Column 1 in success file will show Product IDs
d. Rename the column 1 to Product ID
e. Remove the status column from the file
f. Save as the file as “PricebookEntry Import”
The file will look as below
g. Go to Dataloader
h. Click on insert
i. Click on show all object
j. Select Price Book Entry (PriceBookEntry)
k. Select PricebookEntry Import file and click next
l. Click on Create or Edit a Map
m. Map the fields and columns as below
Active : IsActive
Standard Pricebook ID : Pricebook2Id
Price : Unit Price
Product ID : Product2ID
The mapping will look as below
n. Click on Ok
o. Click on next
p. Select path to store success and error file
q. Click finish
Step 3 (Add products to Custom Price book)
a. Go to Data Loader
b. Click insert
c. Click on show all object
d. Select Price Book Entry (PriceBookEntry)
e. Select PricebookEntry Import file and click next
f. Click on Create or Edit a Map
g. Map the fields and columns as below
Active : IsActive
Custom Pricebook ID : Pricebook2Id
Price : Unit Price
Product ID : Product2ID
The mapping will look as below
h. Click on Ok
i. Click on next
j. Select path to store success and error file
k. Click finish.
Originally published at https://apisero.com on June 27, 2022.