I have a dropdown box that displays supplier data that is sourced from a custom table in Netsuite. The goal here is to reorder the way the supplier data is viewed at the suppliertable level. For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot The desired view for the supplier name is the reverse of that: SupplierName SupplierNumber (APEX - 1230). Essentially just taking the number and moving it to the back of the name and adding a hyphen in the space. However, not every name has a hyphen and some names have 3 names with a supplier number. The code highlighted in my screenshot is the code that will affect the name positioning. Any guidance will be greatly appreciated.
I have a dropdown box that displays supplier data that is sourced from a custom table in Netsuite. The goal here is to reorder the way the supplier data is viewed at the suppliertable level. For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot The desired view for the supplier name is the reverse of that: SupplierName SupplierNumber (APEX - 1230). Essentially just taking the number and moving it to the back of the name and adding a hyphen in the space. However, not every name has a hyphen and some names have 3 names with a supplier number. The code highlighted in my screenshot is the code that will affect the name positioning. Any guidance will be greatly appreciated.
I have a dropdown box that displays supplier data that is sourced from a custom table in Netsuite. The goal here is to reorder the way the supplier data is viewed at the suppliertable level. For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot The desired view for the supplier name is the reverse of that: SupplierName SupplierNumber (APEX - 1230). Essentially just taking the number and moving it to the back of the name and adding a hyphen in the space. However, not every name has a hyphen and some names have 3 names with a supplier number. The code highlighted in my screenshot is the code that will affect the name positioning. Any guidance will be greatly appreciated.
I have a dropdown box that displays supplier data that is sourced from a custom table in Netsuite. The goal here is to reorder the way the supplier data is viewed at the suppliertable level.
For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot
The desired view for the supplier name is the reverse of that: SupplierName SupplierNumber (APEX - 1230). Essentially just taking the number and moving it to the back of the name and adding a hyphen in the space. However, not every name has a hyphen and some names have 3 names with a supplier number.
The code highlighted in my screenshot is the code that will affect the name positioning.
Any guidance will be greatly appreciated.
I have tried using different methods such as split(' ').reverse().join(' ') on that table object but it did not work.
Expert Solution
SuiteScript JavaScript
SuiteScript is a JavaScript-based NetSuite platform that enables complete customization and automation of business processes. The SuiteScript API allows you to access and manipulate critical business records and user information through scripts that run on predefined events. Provides programmatic access to most NetSuite datasets, custom datasets, and event/trigger points.