Applies To
Product: NetSuite 2021.2
Scenario
When printing Invoice transactions that contain serialized items with bins using {item.inventorydetail} in the Advanced PDF Layout, it prints the value in the following format: "serial number,bin number".
This article describes how to print only the "Serial Number", without "Bin Number".
Solution
Printing the "Serial Number" without "Bin Number" can be achieved using a custom field and a User Event script:
-
Create a new Transaction Line Field by navigating to Customization > List, Records & Fields > Transaction Line Field; Set the following parameters:
a. Applies To = Sale Item
b. Type = Text Area
c. Store Value = T
d. ID = _invdetail -
Save the below code snippet as a *.js file on your computer:
-
Create the script record in the NetSuite: Customization > Scripting > Scripts > New > Upload the *.js file > click Create Script Record;
On the Deployments tab select Applies to: Invoice, and Status: Released -
Add the Custom Column field to the Advanced PDF Layout
Disclaimer
The sample code 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