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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Using SuiteScript JavaScript.

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.

Suppliers List
VIEW Default
+ FILTERS
x
EDIT | VIEW
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
Edit | View
INTERNAL ID
125
2
15
82
74
4
124
123
13
114
5
Customize View
SHOW INACTIVES
NAME A
EDIT *
001 - Corporate
100 - Grand Prairie
105 AtlasBX Co., LTD
1070 - Cottage Grove
1080 - La Crosse
120 - Houston
1210- Hamilton
1220 - Miami
1425 Bright Way Group
190 - Waco
190 CLARIOS, LLC
200 - Austin (Legacy)
2022082297 Batteries & Things
New Suppliers
68
67
2022082310 Battery Buyers Of America
57
2022082313 Empire Scientific
103
2022082315 eTech Parts Plus
61
2022082405 Streamlight
56
2022082451 Energizer LLC
112 2022082579 Greenball Tire Corporation
2022082841 Sigmas Tek
2022082842 Selecta Products Inc
119
70
87
2022083255 Battery House
104
2022083298 Eternity Wireless
89
2022083305 Fisher-Price
90 2022083318 INJURED GADGETS
PO/TO
TO
TO
PO
TO
TO
TO
TO
TO
PO
TO
PO
TO
PO
PO
PO
PO
PO
PO
PO
PO
PO
PO
PO
PO
PO
SUPPLIER (BRANCH)
001 - Corporate
100 - Grand Prairie
1070 - Cottage Grove
1080 - La Crosse
120 - Houston
1210- Hamilton
1220 - Miami
190 - Waco
200- Austin (Legacy)
■
SUPPLIER (VENDOR)
105 AtlasBX Co., LTD
1425 Bright Way Group
190 CLARIOS, LLC
2022082297 Batteries & Things
2022082310 Battery Buyers Of America
2022082313 Empire Scientific
2022082315 eTech Parts Plus
2022082405 Streamlight
2022082451 Energizer LLC
2022082579 Greenball Tire Corporation
2022082841 Sigmas Tek
2022082842 Selecta Products Inc
2022083255 Battery House
2022083298 Eternity Wireless
2022083305 Fisher-Price
2022083318 INJURED GADGETS
QUICK SORT
LEAD TIME WEEKS
0
0.5
52.55
0.5
0.5
0.5
0.5
0.5
2.2
0.5
7.24
0.5
2
0.66
1.32
1.95
3
3.09
2
26
2
0.77
1
1
1
001-2022084158
MAX DELIVERY WEIGHT
1
43,000
43,000
List Search Audit Trail
> TOTAL: 122
CALCULATED LEAD TIME WEEKS
52.55
2.2
7.24
2.9
0.66
1.32
1.95
1.98
3.09
1.39
1.67
0.77
(0.08)
8.59
4:26 PM
Transcribed Image Text:Suppliers List VIEW Default + FILTERS x EDIT | VIEW Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View Edit | View INTERNAL ID 125 2 15 82 74 4 124 123 13 114 5 Customize View SHOW INACTIVES NAME A EDIT * 001 - Corporate 100 - Grand Prairie 105 AtlasBX Co., LTD 1070 - Cottage Grove 1080 - La Crosse 120 - Houston 1210- Hamilton 1220 - Miami 1425 Bright Way Group 190 - Waco 190 CLARIOS, LLC 200 - Austin (Legacy) 2022082297 Batteries & Things New Suppliers 68 67 2022082310 Battery Buyers Of America 57 2022082313 Empire Scientific 103 2022082315 eTech Parts Plus 61 2022082405 Streamlight 56 2022082451 Energizer LLC 112 2022082579 Greenball Tire Corporation 2022082841 Sigmas Tek 2022082842 Selecta Products Inc 119 70 87 2022083255 Battery House 104 2022083298 Eternity Wireless 89 2022083305 Fisher-Price 90 2022083318 INJURED GADGETS PO/TO TO TO PO TO TO TO TO TO PO TO PO TO PO PO PO PO PO PO PO PO PO PO PO PO PO SUPPLIER (BRANCH) 001 - Corporate 100 - Grand Prairie 1070 - Cottage Grove 1080 - La Crosse 120 - Houston 1210- Hamilton 1220 - Miami 190 - Waco 200- Austin (Legacy) ■ SUPPLIER (VENDOR) 105 AtlasBX Co., LTD 1425 Bright Way Group 190 CLARIOS, LLC 2022082297 Batteries & Things 2022082310 Battery Buyers Of America 2022082313 Empire Scientific 2022082315 eTech Parts Plus 2022082405 Streamlight 2022082451 Energizer LLC 2022082579 Greenball Tire Corporation 2022082841 Sigmas Tek 2022082842 Selecta Products Inc 2022083255 Battery House 2022083298 Eternity Wireless 2022083305 Fisher-Price 2022083318 INJURED GADGETS QUICK SORT LEAD TIME WEEKS 0 0.5 52.55 0.5 0.5 0.5 0.5 0.5 2.2 0.5 7.24 0.5 2 0.66 1.32 1.95 3 3.09 2 26 2 0.77 1 1 1 001-2022084158 MAX DELIVERY WEIGHT 1 43,000 43,000 List Search Audit Trail > TOTAL: 122 CALCULATED LEAD TIME WEEKS 52.55 2.2 7.24 2.9 0.66 1.32 1.95 1.98 3.09 1.39 1.67 0.77 (0.08) 8.59 4:26 PM
34 }
35
36 function fieldChanged (type, name)
37 ▾ {
38
39 ▾
40
41
42
43
44
45
46
47 ▾
48
49
50
51
52 ▾
53
54
55
56
57 -
58
59
60
61
62
63
64 ▼
65
66
67
68
69
if (name == 'custrecord_supplier_record_po_or_to')
{
}
}
nlapisetFieldValue('name', null);
nlapisetFieldValue('custrecord_supplier_record_vendor',
nlapisetFieldValue('custrecord_supplier_record_branch', '');
null);
var poto nlapiGetFieldValue (name);
if (poto
{
}
}
else
{
}
else if (poto
{mm
}
=
nlapiGetField('custrecord_supplier_record_vendor').setDisplayType('normal');
nlapiGetField('custrecord_supplier_record_branch').setDisplayType('disabled');
==
1)
if (name
{
nlapiGetField('custrecord_supplier_record_branch').setDisplayType('normal');
nlapiGetField('custrecord_supplier_record_vendor').setDisplayType('disabled');
==
==
2)
nlapiGetField('custrecord_supplier_record_branch').setDisplayType('disabled');
nlapiGetField ('custrecord_supplier_record_vendor').setDisplayType('disabled');
'custrecord_supplier_record_vendor' || name == 'custrecord_supplier_record_branch')
var supplier = nlapiGetFieldText (name);
nlapiSetFieldValue ('name', supplierSliced);
Transcribed Image Text:34 } 35 36 function fieldChanged (type, name) 37 ▾ { 38 39 ▾ 40 41 42 43 44 45 46 47 ▾ 48 49 50 51 52 ▾ 53 54 55 56 57 - 58 59 60 61 62 63 64 ▼ 65 66 67 68 69 if (name == 'custrecord_supplier_record_po_or_to') { } } nlapisetFieldValue('name', null); nlapisetFieldValue('custrecord_supplier_record_vendor', nlapisetFieldValue('custrecord_supplier_record_branch', ''); null); var poto nlapiGetFieldValue (name); if (poto { } } else { } else if (poto {mm } = nlapiGetField('custrecord_supplier_record_vendor').setDisplayType('normal'); nlapiGetField('custrecord_supplier_record_branch').setDisplayType('disabled'); == 1) if (name { nlapiGetField('custrecord_supplier_record_branch').setDisplayType('normal'); nlapiGetField('custrecord_supplier_record_vendor').setDisplayType('disabled'); == == 2) nlapiGetField('custrecord_supplier_record_branch').setDisplayType('disabled'); nlapiGetField ('custrecord_supplier_record_vendor').setDisplayType('disabled'); 'custrecord_supplier_record_vendor' || name == 'custrecord_supplier_record_branch') var supplier = nlapiGetFieldText (name); nlapiSetFieldValue ('name', supplierSliced);
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.

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY