Generating Printable Package Labels
To quickly and easily ship products, end users can generate printable package labels directly from sample transfer and return records. To ensure accuracy, product information on the package label is copied from the corresponding Sample Transaction record. Sample admin users can upload customized package label templates to modify which fields display on the package label.
Who can use this feature?
- Sample Admin Users — Browser
- Creating Package Label Templates
- Creating Token Mapping Files
- Uploading and Publishing Package Label Templates
- End Users — Browser
- Generating Printable Package Labels
- Users do not require an additional license
Configuring Printable Package Labels for
To configure this feature:
-
Ensure Configuring Sample Management is complete.
-
Navigate to Admin > Users & Groups > Permission Sets.
-
Select the appropriate permission set.
-
Select the Objects tab.
-
Select sample_transaction__v.
-
Grant Execute permission for the create_package_label__v (Create Package Label) object action.
-
Ensure sample admin users have Create Document Permission for the following Dynamic Word Template document types:
- sample_transfer_package_label__v
- sample_return_package_label__v
See How to Edit Document Types for more information.
To configure this feature:
-
Ensure Configuring Sample Management is complete.
-
Navigate to Admin > Users & Groups > Permission Sets.
-
Select the appropriate permission set.
-
Select the Objects tab.
-
Select sample_transaction__v.
-
Grant Execute permission for the create_package_label__v (Create Package Label) object action.
-
Navigate to Admin > Configuration > Objects > sample_transaction__v.
-
Select the Object Types tab.
-
Select Actions.
-
Select Edit Object Type Actions from the All Actions menu.
-
Enable the create_package_label__v (Create Package Label) action for the transfer__v and return__v object types.
-
Ensure end users are included as Viewers in the Default Settings for New Documents for the following Dynamic Word Template document types:
- sample_transfer_package_label__v
- sample_return_package_label__v
See How to Edit Document Types for more information.
Creating Package Label Templates as
Sample admin users can download a sample transfer package label template and a sample return package label template, both of which include token mapping files. After making any desired updates according to the guidelines below, sample admins can upload a .zip file with the template and field mappings for use in Vault CRM. The .zip file must contain:
- One .docx file consisting of the package label template. Any formatting used in the .docx file is reproduced in the package label output.
- One .txt or .tsv file defining how merge fields in the .docx file map to tokens in Vault CRM. This file must contain exactly two rows: one row of merge fields and one row of corresponding tokens.
Creating the Package Label Template
To create a .docx file for a package label template:
-
Create the template as a .docx file in Microsoft Word. For guidelines, see Formatting Guidelines for Package Label Templates.
-
Use Mail Merge to insert merge fields for tokens in the .docx file. Merge field labels must meet the following requirements:
- Alphanumeric and underscores only (no spaces or special characters)
- No more than 40 characters in length
- Exactly match the merge_field_label values in the token mapping file
-
Ensure users have at least Read permission for all fields referenced in the template. If users are not granted permission for a referenced field, the field value does not render on the package label.
-
Save the template.
Formatting Guidelines for Package Label Templates
The following are guidelines for character encoding and layouts:
- Character encoding must be UTF-8
- Page size and margins:
- Margins of at least 0.5 inches on all sides are recommended
- Ensure the document renders properly and does not result in clipping, misalignment, or unreadable content
- Layout best practices:
- Use tables to structure content wherever possible. Tables provide consistent layout and spacing during the conversion from .docx to .pdf.
- Avoid using floating text boxes, wrapped images, or embedded objects
The following fonts are recommended, with a font size of 12pt or larger:
- Arial
- Calibri
- Courier New
- Times New Roman
Sample admins may use fonts outside the recommended list if the .docx file embeds the font and the font is fully licensed for Microsoft Word embedding.
Before publishing, Veeva recommends sample admins confirm:
- The embedded font is preserved during document conversion
- All text remains readable in the label output, including small and bold text
- Layout, spacing, and line wrapping are not affected by font substitution
Creating Token Mapping Files as
Package label templates rely on a token mapping file to map the merge field labels in the .docx file to corresponding Vault CRM tokens. Merge fields are populated with token values from Vault CRM when the package label document is published.
To create a token mapping file:
-
Create a tab-delimited text file (.txt or .tsv) containing two rows to map the merge field labels to corresponding Vault CRM tokens.
-
Enter the merge field labels from the .docx file in the first row.
-
Enter the corresponding CRM token for each merge field in the second row.
-
Save the file.
Formatting Requirements
The following is a list of formatting requirements for token mapping files:
- The file must be a tab-delimited text file (.txt or .tsv)
- The file must include exactly two rows:
- merge_field_label - Column headers representing merge fields in the .docx file (for example, Submitted_Date, Sender_Address)
- token - Corresponding Vault CRM token values (for example, {{sample_transaction__v.submitted_date__v}}, {{senderRepRoster.address_line_1__v}}
- Each column maps one merge field in the .docx file to a supported token
- Each merge_field_label must exactly match a merge field in the .docx file
- The file must not contain duplicate merge_field_label entries
- The file must not contain empty fields
- Merge field labels must not contain spaces or special characters
- The file must include valid tokens
Supported Package Label Tokens
Tokens are used to customize the data displayed on package labels, retrieving data from fields on the primary Sample Transaction and its related object records (Rep Roster, Sample Lot, and Product Catalog).
The following field types are supported for package label tokens:
- Text
- Number
- Date
- DateTime
- Yes/No
- Picklist (resolves to the picklist label in the user's language)
The following tokens can be used to customize package labels:
|
Token |
Description |
|---|---|
|
{{sample_transaction__v.FieldAPIName}} |
Retrieves a field value from the initiating Sample Transaction (sample_transaction__v) record. Example: {{sample_transaction__v.submitted_date__v}} |
|
{{totalNumberOfSampleLines}} |
Returns the total count of individual sample line items included in the package label table. Do not include this token in a table where the {{repeatRow}} token is used. |
|
{{senderRepRoster.FieldAPIName}} |
Retrieves field values from the Rep Roster (rep_roster__v) record of the user shipping the products.
Example: {{senderRepRoster.address_line_1__v}} Do not include this token in a table where the {{repeatRow}} token is used. |
|
{{recipientRepRoster.FieldAPIName}} |
Retrieves field values from the Rep Roster (rep_roster__v) record of the user receiving the products.
Example: {{recipientRepRoster.address_line_1__v}} Do not include this token in a table where the {{repeatRow}} token is used. |
|
{{sampleProductCatalog.FieldAPIName}} |
Retrieves field values from the Product Catalog (product__v) record associated with the sample item. Example: {{sampleProductCatalog.manufacturer__v}} |
|
{{sample_transaction__v.lot__vr.FieldAPIName}} |
Retrieves field values from the Sample Lot (sample_lot__v) record associated with the specific sample line item. Example: {{sample_transaction__v.lot__vr.expiration_date__v}} |
|
{{repeatRow}} |
Repeat the row for each value returned by the defined criteria. Using this field on a package label results in rows for each sample transaction the user selects. The token must be located in the leftmost cell of the row. |
Uploading and Publishing Package Label Templates as
To upload and publish a new package label template:
-
Create a .zip file that contains both the .docx template file and, if tokens are used, the token-mapping .txt file. Place both files at the root level of the .zip.
-
Navigate to the Library tab.
-
Select Create Document from the Global Create button.
-
Select Upload.
-
Select Continue.
-
Upload the .zip file containing the .docx file and the token mapping text file (.txt or .tsv).
-
Select Dynamic Word Template as the Document Type.
-
Select Next.
-
Select the appropriate value from the Dynamic Word Template Type picklist:
- Select Sample Transfer Package Label for transfer templates
- Select Sample Return Package Label for return templates
-
Ensure the Publish for Veeva CRM (Fax) option is set to No. If Publish for Veeva CRM (Fax) is set to Yes, the template is created as a fax template and output is limited to three pages.
-
Select Save. For new templates, the contents of the .zip file are validated and processed at this point. When the .zip file is processed, the following files are generated:
- A .pdf rendition of the .docx file
- A .json file containing metadata for each token, including the location of merge fields within the template
- A .png file with a thumbnail image for the document, based on the first page of the .pdf rendition
-
Change the document lifecycle state to Staged. The .zip file and its extracted contents are published to the CDN. Admins can review file output at this stage to ensure package labels render correctly.
Ensure the CDN Path field is populated and the CDN Processing Status displays as Success in the CDN Publishing Details section of the document's Information panel. If these fields are not populated by the CDN process, the Generate Package Label button is not selectable for end users.
-
Change the document lifecycle state to Approved to make the template available for use.
Ensure the .zip file includes exactly one .docx file and one .txt/.tsv file. Both the .docx file and the .txt/.tsv file must have the same exact name as the .zip file. Non-UTF8 characters are not supported in the .zip file name. If the uploaded .zip file does not contain exactly one .docx and one .txt/.tsv file, or if the file names do not match the .zip name, processing fails.
Product, Language, and Country values are not used for package labels, if populated in the Product Information section of the document's Information side panel. These values are used for other document types, for example, fax templates.
Updating Existing Templates
When updating an existing template, select the Process Content document action from the All Actions menu after uploading the updated .zip file and moving it through the Staged state to the Approved state. The Process Content document action validates and processes the content of the updated .zip file, generating new .pdf, .json, and .png files for the template.
If multiple templates are available for either package label type, the most recently modified version is used based on the Last Modified Date (modified_date__v) field on the Document record.
Generating Printable Package Labels as
End users can generate a printable package label in .pdf format, containing a shipping label and manifest from a submitted sample transaction. Package labels are typically used when transferring products to another user or when returning products.
To generate a package label:
-
Navigate to the Sample Transactions tab in the Sample Management tab collection.
-
Select the All Actions menu for a submitted Sample Transaction record (Transfer or Return type).
-
Select Create Package Label.
-
Review the list of Transactions on the selection page. The selection page displays transactions sharing the same Transfer To/From or Return To/Adjust For parties and addresses. Records created between 14 days prior and one day after the source transaction are included.
-
Select the transactions to include in the package. If the transaction is part of a Multi-Line Transactions group, all transactions in the group are automatically selected.
-
Select Generate Package Label. The label opens as a .pdf file in a new browser tab.
-
Select Print.

