Associate Products to Standard Price Book and Custom Price Books via the Data Loader in Salesforce

Salesforce is a widely used robust CRM tool that facilitates streamlining pricing through Price Books in the Salesforce org. The Price Books in Salesforce serve as catalogs for product pricing, allowing businesses to define different prices for products based on various criteria.

In this Salesforce tutorial, we will learn to associate products with both Standard Price Books and Custom Price Books using the Salesforce Data Loader.

Data loader to associate products to price books

In Salesforce, a Data Loader is a powerful tool that enables bulk data import and export operations, and using a data loader to associate products with standard and custom price books can be advantageous in various ways, especially when dealing with large datasets or systematically managing the pricing information of the products.

Associate Products to Standard Price Book via data loader

Before inserting or associating products to price books, we will run an export for the data object Price Book 2 by following the steps.

  • Open the Data Loader.
  • Export the ‘PriceBook2‘ object.
  • We need ‘PriceBook2 ID‘ to prepare the insert CSV file.
  • Save the file in an easy-to-access location.

After the data export follow the below steps to associate Products to Standard Price Book via data loader.

1. Create a CSV file with the following header columns.

  • Product2ID: This is the ID of the product to be associated with the Price Book. Product ID starts with ’01t’. To get the Product ID, you can use Data Loader to export Product (Product2).
  • PriceBook2ID: Get the Standard Price Book ID from the exported data CSV file.
  • CurrencyIsoCode: Use this column if you have multiple-currency else, you can disregard this column.
  • Unit Price: This is the List Price/Standard Price field for the Product.
  • UseStandardPrice: leave this column blank and do not map this field for Standard Price Book.
  • IsActive: TRUE (must be TRUE to insert – this can be changed to FALSE after data insertion).
Associate products to pricebooks via Salesforce data loader

2. After preparing the CSV file, open the data loader and log in with your credentials, then click on the Insert button.

Associate products to pricebooks with Salesforce Data loader

3. In this step, activate the checkbox Show all Salesforce objects, select the data object Price Book Entry, and then browse the CSV file that we have created in the above steps.

See also  How to Freeze or Unfreeze Multiple Users via Salesforce Data Loader

After this, click on the Next button.

Use data loader to associate products with price books

4. Now the data loader will initialize the uploaded CSV file, here click on the OK button to proceed.

5. Now, in this step, we will map the CSV header columns with the object field names, and for that, click on the button Create or Edit a Map. Then, in the next window, click on the button Auto-Match Fields to Columns.

Now the field names will be auto-matched to the header columns, and if not, then you have to the salesforce object fields down to the column mapping.

After mapping, click on the button Save Mapping, then click on Next.

Associate products to standard price books via Salesforce data loader

6. In this step, select the location for the error and the success files from where it can be accessed later. At last, click on the Finish button.

Use data loader to associate products with standard price books

7. Now, we will see a warning message on the screen regarding the data insert operation. Here, click on the Yes button to proceed.

Salesforce Products association to price books via data loader

8. Now, the data import will start, and after its completion, we will get the number of successes and errors that occurred during the data import operation.

Here, we got 6 successes and 2 error messages in the dialog box. Here, we got 2 errors because 2 products were already listed in that price book. So make sure not to repeat the listings of products to a single price book.

To close the data loader, click on the OK button.

Use Salesforce data loader to associate products with price books

9. Now, to view the products associated with the price books, open the Salesforce developer console and navigate to the Products tab.

See also  How to Import Leads as Campaign Members with Data Loader in Salesforce

Now the select product with which you have associated the price books.

Products associated to price books via Salesforce data loader

Now, we can see the price books that are associated with the products. In this way, we can associate the Standard price book voa Salesforce data loader by following the above steps.

Associate Products to Custom Price Book via data loader

To associate products to a custom price book via data loader then, follow the below steps.

1. Create a CSV file with reference to the CSV file that we created for the standard price books in the above steps. Here, change the IDs of the standard price books with the IDs of custom price books.

The field UseStandardPrice plays an important role in inserting Price Books for custom Price Books: This should be TRUE (or 1) or FALSE (or 0) and indicates whether to use the price from Standard Price Book or not.

Associate products to standard and custom price books via Salesforce data loader

2. Now open the data loader and click on the Insert button.

3. Activate the checkbox Show all Salesforce objects, then select the data object Price Book Entry, and then select the CSV file that we have created with IDs of custom price books.

After this, click on the Next button.

Use Salesforce data loader to associate products with custom price books

4. In this step, create the mapping between the CSV header columns and the object field names, and to do that, click on the button Create or Edit a Map. Then, in the next window, click on the button Auto-Match Fields to Columns.

If the column headers are not auto-mathched, then you have to drag the object fields down to the column mapping. After mapping, click on the OK button, then click on the Next button.

Associate products to custom pricebooks via Salesforce data loader

5. Select the location for the errors and successes filles from where it can be accessed later.

See also  How to Import Users Using Data Loader In Salesforce

At last, click on the Finish button.

Salesforce data loader to associate products with custom and standard price books

6. After the completion of the data insert operation, we can see the number of successes and errors in a dialog box that occurred in the data operation. Here, click on the OK button to close the data loader.

Associate Products to Standard Price Book via the Data Loader in Salesforce

7. Now, to view the products associated with the price books, I will open the Salesforce developer console and navigate to the Price Books tab because I have assigned multiple products to a single price book.

You can also view the associated products from the Products tab.

Associate products to standard and custom Price Books with Data Loader

As we can see in the above image, the products are associated with the custom price books. In this way, we can associate the products to custom price books by following the above steps.

Conclusion

In Salesforce CRM, using a data loader for associating products with standard and custom price books provides efficiency, accuracy, and scalability, making it a valuable tool for managing pricing information in a business environment.

By following the above example, you might have better understood the process of associating products to standard Price Book and custom Price Books via the Data Loader in Salesforce.

You may like to read: