There are times that the Location on a Transaction record has Sub-location. As a standard behavior, the value that will show on the Location field would be Parent Location : Sub Location. Some would need to show only the sublocation on records or even on reports and Advanced PDF Printout so that it will not cause confusion to the customers on where the location should be. If this is the case, there are a couple of things we should accomplish.
1. Create a Saved Search
a. Navigate to Lists > Search > Saved Searches > New
b. Select Transaction
c. Set the following:
· Title : Sublocation
· Public : Enter Checkmark
· Criteria:
· Type: select the applicable transaction type(s)
· Main Line: is true
· Results:
· Field : Select Location Fields…
· Location Fields… : Select Name (no hierarchy)
· Summary Type: Select Maximum
· Available Filter
· Field : Select Internal ID
2. Create a Transaction Body Field
a. Navigate to Customization > Lists, Records, & Fields > Transaction Body Fields > New
b. Set the Following:
· Title: Enter Sublocation
· ID: Enter _sublocation
· Store Value: Remove Checkmark
· Display subtab
· Subtab: Select Main
· Display Type: Select Inline Text
· Applies to: select the applicable transaction type(s)
· Validation & Defaulting subtab
· Search : Select the created saved search above
3. Add the Custom Field to the Advanced PDF/HTML Template
a. Navigate to Customization > Forms > Advanced PDF/HTML Templates
b. Click Edit/Customize on preferred form
c. Toggle Source Code and add the code below:
<tr><th>${record.custbody_sublocation@label}</th></tr><tr><td style="padding-top: 2px;">${record.custbody_sublocation}</td></tr>
Do you have other ideas on how to solve this that you want to share with us?