Help Center

Dataload: File Attachments (Items)

Intended Audience: Propel Consultants and Partners and experienced Salesforce Administrators who are comfortable working with large data sets and importing directly into Salesforce custom objects.

Note to Users: If you need to import data from a spreadsheet or CAD system please see the article Import Item Data. The Propel import tool is designed for Propel users and provides an easy way to import data for most use-cases.

Scope: This document describes how to load data into Propel for large sets of data, and particularly for dataloads containing multiple revisions of Items, BOMs and AML, where each revision must be released. Typical data sets include data from legacy PLM and ERP systems.

Tools: This article discusses loading data using standard Salesforce import tools: the Import Wizard and Data Loader. Prior knowledge of these tools is assumed. See our article on Bulk Updates for details about how to use the Data Loader.

Required Privileges: You must have Salesforce System Administrator privileges to use the tools referenced in this article.

Disclaimer: Propel Support is not responsible for data integrity errors or data loss resulting from importing data directly into Salesforce custom objects. It is assumed that the reader of this article is experienced with Salesforce objects and schema and has prior experience performing data migrations.

Technical Support: The Propel Support organization cannot assist with data migration efforts. You may choose to contract with Propel Implementation Services for paid assistance with these activities.

Environment: It it strongly recommended that you perform dataload activities in a Sandbox environment first.

Prerequisites: Your user account must have the permission set Propel Override Business Rules. In addition, all Item objects to which you intend to associate file attachments must already exist.

 

FILE ATTACHMENTS (ITEMS)

This document describes how to bulk-load file attachments onto Propel Items. Note that the process for attaching files to Changes and Quality records is different.

You will follow these general steps to bulk-load file attachments onto Items:

A. Upload All Files to Salesforce
B. Make an Import File
C. Get the IDs for the Files You Previously Uploaded
D. Get the IDs for All Item Revisions
E. Merge Values into your Import File
F. Run the Data Loader to Associate Items with File Attachments

 

A. Upload All Files to Salesforce

1. Display the Salesforce Files tab.

2. Drag all your files into the Salesforce Files area.

 

 

 

B. Make an Import File

1. Just in case you don’t already know how to get a good file listing to use as a basis for your import file, here is an example series of PC Command Prompt commands.

c:
cd \
cd attachments (assuming you have a folder called c:\attachments)
dir /s/on/b/a-d >> filelist.txt

This command means list directory with subdirectories (s), sort by name (on), use bare format (b), don't list any directories without files (a-d), output to a file called filelist.txt.

If you're using a Mac you're on your own; Google how to list files.

 

2. Copy and paste the contents of filelist.txt into an Excel file and arrange the data like the example below.

Note that in the example above all the values in Column A have asterisks at the end. This is how Propel denotes an unreleased (draft) revision. If your items are released you don't need the asterisk.

 

C. Get the IDs for the Files You Previously Uploaded

 1. Use the Salesforce Data Loader to run a query (export) on ContentDocument:

 From the DataLoader, choose Export

Check the box “Show all Salesforce objects”
Choose the object ContentDocument
Export these fields:

ID
Title (this is where the filename is stored)
FileExtension
LatestPublishedVersionId

 

D. Get the IDs for All Item Revisions

1. Use the Data Loader to run a query (export) on the Item Revision object. Include these fields:

ID
Name
Master Item Number (PDLM__Master_Item__c)
Revision (PDLM__Revision__c)

 

E. Merge Values into your Import File 

1. Open the Excel import file that you prepared earlier.

2. Use your Excel superpowers to merge in the Item Revision IDs.

3. Now merge in these two ContentDocument fields:

ID
LATESTPUBLISHEDVERSIONID

4. The final import file needs the following columns:

Item Revision              ID of the Item Revision record

File Name                    The user-readable filename (yes, File <space> Name)

Description                   Usually the same as the filename, though you can provide a
                                   description such as “Datasheet” or “File Attachment” if you wish

Content ID                   The ID of the corresponding Content Document object

Version                        The LATESTPUBLISHEDVERSIONID of the corresponding
                                   ContentDocument object

 

Example Excel file:

 

F. Run the Data Loader to Associate Items with File Attachments

1. Use the Data Loader to insert new objects:

(Show all Salesforce objects)

Object:  Attachment (PDLM_Document__c)

Mapping:

2. Assuming the import was successful, the files are now attached to Propel items.

3. If the import was NOT successful, it's possible that you got some error messages like this:

PDLM.DocumentTrigger: System.LimitException: PDLM:Too many SOQL queries: 101

Here's what to do.

a. On the main screen of the Data Loader, go to Settings.

b. Choose a Batch Size of 1.

c. Save your changes. (If you are using a PC with a small screen, you won’t see the Save button. Simply hit Enter and your changes will be saved. Look at Settings again to confirm.)

d. Re-run the import.

e. Celebrate the fact that you now have some really amazing dataload skills.

f. A batch size of 1 makes the import run very slowly. After the import don’t forget to change the batch size back to 200.

 

4. Spot-check a few items in Propel to confirm that the files are attached correctly.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.