There are instances wherein companies need to display the Location Address on their Packing Slip PDF printouts depending on the Location selected on the Sales Order.
Solution
- Create a Custom Transaction Body Field on the Sales Order
- Navigate to Customization > Lists, Records, & Fields > Transaction Body Fields > New
- Label: Enter Label
Example: Location Address - ID: Enter _so_loc_address
- Type: Select Free-Form Text
- Store Value: Remove Checkmark
- Click Sourcing & Filtering
- Source List: Select Location (Main)
- Source From: Select Address
- Click Save
- Create a Custom Transaction Body Field on the Item Fulfillment
- Navigate to Customization > Lists, Records, & Fields > Transaction Body Fields > New
- Label: Enter Label
Example: Location Address From Sales Order - ID: Enter _from_so_loc_address
- Type: Select Text Area
- Store Value: Remove Checkmark
- Click Validation & Defaulting
- Default Value: Enter {createdfrom.custbody_so_loc_address}
- Click Save
- Modify the Advanced PDF/HTML Template
- Navigate to Customization > Forms > Advanced PDF/HTML Templates
- Preferred Packing Slip PDF/HTML Template: Click Edit or Customize
- Top right corner: Toggle Source Code
- Look for the prints the Company Address
- Change the code to:
<td style="font-size: 7pt;" align="right"><span class="nameandaddress">${record.custbody_from_so_loc_address}</span><br/><br/></td>Copy - Click Save