---
schema_version: "1"
id: a9435aaff642aec1441eeee490bf66df645ac038710cfe26710e061b5ca340d9
title: Set Up Optional Sample Data for Contractor Portal
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/energy_cp_set_up_sample_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.energy_cp_set_up_sample_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 127ca15e626bc6242fccfb8e2e57d2c6873899de34e11128be69ccdd58371a15
description: To test the features of Contractor Portal with test data, you can deploy this sample data to your org.
products:
  - Energy and Utilities
release: "264"
---
# Set Up Optional Sample Data for Contractor Portal

To test the features of Contractor Portal with test data, you can deploy this sample data to your org.

While you can set up sample data in your production org if you wish, consider adding the sample data to a sandbox instead.

The Contractor Portal sample data is available as downloadable files. To download and then deploy the data to your target org, follow these instructions:

1. Add sample images.
    1. To upload images to the Salesforce Files section in your org from the file [EnergyCPImages.zip](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/EnergyCPImages.zip), from the App Launcher, click **Files**, and then click **Upload Files**.
    2. Enter the image name. For products, use the product code as the image name. For programs, use the program name without the special characters and spaces as the image name.
    3. For every uploaded image, from the dropdown.
        
        ![Enable Customer Access for each image.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-energy_utilities-264-0-0-production-enus/520849e5-9b41-4bae-b97b-d269cc2fce83/energy_utilities/images/energy_cp_image_customeraccess.png)
    4. Click **Share**, then under Who Can Access, turn on Customer Access, turn off Expiration date, and then click **Done**.
2. Download these apex class files to your computer: [EUProgramSampleData](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/EUProgramSampleData.cls) and [EUProgramCreateSampleData](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/EUProgramCreateSampleData.cls).
3. Create new Apex Classes.
    1. Go to Setup.
    2. In the Quick Find box, search for Apex Classes, then click **Apex Classes**.
    3. Click **New**.
    4. Copy the code from the CLS file on your system and paste it in the Apex Class window.
    5. Click **Save**.
    6. Enter the filename of the CLS file as the name of the new Apex Class.
4. Open an anonymous window in developer console.
    1. Click **Setup**, then click **Developer Console**.
    2. In the Developer Console, click **Debug**, then click **Open Execute Anonymous Window**.
5. Paste the code snippet in the anonymous window: `EUProgramCreateSampleData.createRecords();`.
6. Click **Execute**.
7. Delete the EUProgramSampleData and EUProgramCreateSampleData classes.
    1. Go to Setup.
    2. In the Quick Find box, search for Apex Classes, then click **Apex Classes**.
    3. Delete the classes that you created from the Apex Classes list.
        
        You must delete the classes in reverse order of creation.
8. (Optional) Activate picklist values of the Product Family field in the Product2 object. See [Add or Edit Picklist Values](https://help.salesforce.com/s/articleView?id=platform.updating_picklists.htm&type=5&language=en_US).
9. Assign a business license to an account.
    1. From the App Launcher, find and select **Business Licenses**.
    2. Click **New**.
    3. In New Business License, enter the details of a business license and associate it with the account of your choice.
        
        For example, enter the name of the license, select the current date for **Period Start**, select any future date for **Period End**, enter the identifier for the license, select the account, and select **IsActive**.
    4. Save your changes.
10. Add a role to the contact.
    1. Open the Developer console. See [Developer Console](https://help.salesforce.com/s/articleView?id=platform.code_dev_console.htm&type=5&language=en_US).
    2. Run this query:
        
        ```
        select id, <AccountID>, <ContactID>, roles from AccountContactRelation
        ```
        
        where AccountID is the account for which you want to set ContactID as primary.