Scenario
Currently, there is no way to print Transaction Body/Line Fields that has been sourced from a different record on Advanced PDF/HTML Templates. A custom field and workflow can be used as a workaround for this limitation.
Solution
I. Create a Custom Transaction Body Field
-
Navigate to Customization > Lists, Records, & Fields > Transaction Body Fields > New
-
Custom Transaction Body Field main setup:
-
Enter "Project Name" on the Label field
-
Enter "_stmnt_proj_name" on the ID field
-
Select Free-Form Text on the Type drop-down field
-
Tick Store Value box
-
Under Applies To tab
-
Tick Sales box
-
Tick Print On Statement box
-
-
-
Click Save
II. Create a Workflow
-
Navigate to Customization > Workflow > Workflows > New
-
Basic Information:
-
Enter "Add Project Name" as the Name of the workflow
- Select Transaction as Record Type drop-down field
-
Select Purchase Order as Sub Types drop-down field
-
Tick Execute As Admin box
-
Select Released as Release Status drop-down field
-
Tick Event Based on Initiation, tick Create box
-
Select Before Record Load as Trigger Type drop-down field
Click Save
Click State 1
Click + New Action at the bottom-right corner
Click the Set Field Value link
Basic Information section:
-
Select Entry as the Trigger On drop-down field
Parameters section:
-
Select Project Name as the Field
-
Under Value sub-section: Tick From Field radio button then Select Current Record as Record (Join Field) drop-down field and select Job (Main) on Field drop-down field
Click Save
III. Customize the Advanced PDF/HTML Template
-
Navigate to Customization > Forms > Advanced PDF/HTML Templates
-
Click Customize on "Standard Statement PDF/HTML Template"
- Click the Template Setup button
- Enter your preferred Title or name for this template.
- Tick the Template is Preferred box
- Click Save button
-
Leave the Project Label as is
-
Change the Project value to = ${line.custbody_stmnt_proj_name}
-
Click Save
NOTE: If the template layout has already been toggled to Source Code, the user must add the project field ID via HTML/CSS code.
DISCLAIMER
The sample setup described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.
Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness, or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.
Oracle + NetSuite Inc. shall not be liable for any direct, indirect, or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.