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. For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot The desired view for the supplier dropdown is the reverse of that: SupplierName SupplierNumber (APEX - 1230). The variable highlighted is the internal ID of the table sourcing the Supplier dropdown field supplierField variable: var supplierField = form.addField('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayoutType('startrow'); 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.

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.

For example, currently the supplier data is displayed: SupplierNumber SupplierName (1230 - APEX). UI Screenshot

The desired view for the supplier dropdown is the reverse of that: SupplierName SupplierNumber (APEX - 1230).

The variable highlighted is the internal ID of the table sourcing the Supplier dropdown field supplierField variable: var supplierField = form.addField('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayoutType('startrow');

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.

var today = (date.getMonth() + 1) + '/' + (date.getDate()) + '/'
+ (date.getYear() + 1900);
var form = nlapiCreateForm ('Demand Order');
form.setScript('customscript_cl_dp_order_items');
form.addSubmit Button('Place Order');
form.addButton('custbutton_altview',
form.addButton('custbutton_export_csv',
// Show Gap Fill button when you have a specific role
if (specialRoles.indexOf(ctx.getRoleId()) > -1 && !isNullOrEmpty (supplier))
{
}
else
{
var gapLabel = (gapFill == 'T')? 'Remove Gap Fill' : 'Add Gap Fill';
form.addButton('custbutton_gapfill', gapLabel, 'addGapFill');
var demandLabel = (altDemand == 'T') ? 'Use OG Demand': 'Use Demand B';
form.addButton('custbutton_altdemand', demandLabel, 'changeDemand');
'Change View', 'changeView');
'Export to CSV', 'exportCSV');
gapFill= 'F';
{
}
var branchField = form.addField ('custpage_branch', 'select', 'Branch').setLayout Type('normal', 'startcol').setMandatory(false);
var dateField = form.addField('custpage_date', 'date', 'Order Date').setMandatory (true);
}
var msgField = form.addField('custpage_message', 'inlinehtml', 'Message');
var supplierField = form.addField ('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayout Type('startrow');
var supplierLeadField = form.addField ('custpage_supplier_lead_time', 'text', 'Supplier Lead Time').setDisplayType('hidden');
var potoField = form.addField('custpage_po_or_to', 'select', 'PO/TO').setDisplayType('hidden');
var qtyField = form.addField ('custpage_qty', 'integer', 'Total Qty.').setDisplayType('inline').setLayout Type('normal', 'startcol');
var weightField = form.addField ('custpage_weight', 'integer', 'Total Weight').setDisplayType('inline');
var itemField = form.addField ('custpage_item', 'select', 'Item', 'inventoryitem');
var reorderField = form.addField ('custpage_reorder', 'checkbox', 'At or below reorder');
var reorderPointCalcField = form. addField ('custpage_reorder_calc', 'text', 'Reorder Point Calculation (Only Applies to Auto)').setDisplayType('inline').set Layout Type ('normal', 'startcol');
var stockLevelCalcField = form.addField ('custpage_stock_level_calc', 'text', 'Preferred Stock Level Calculation (Only Applies to Auto)').setDisplayType('inline')
var plannerField = form.addField ('custpage_planner', 'select', 'Planner', 'employee').setDisplayType('inline');
var savedField = form.addField ('custpage_selected_lines', 'longtext', 'Selected IDs').setDisplayType('hidden');
var submitField = form.addField ('custpage_submit', 'checkbox', 'Ready to Submit').setDisplayType('hidden');
var viewField = form.addField ('custpage_altview', 'checkbox', 'Alt View').setDisplayType('hidden');
var gapField = form.addField('custpage_gapfill', 'checkbox', 'Gap Fill').setDisplayType('hidden');
var altDemandField = form.addField('custpage_altdemand', 'checkbox', 'Alt Demand View').setDisplayType('hidden'); // demandB
// Hide "select a supplier" message when the supplier has been selected and set Planner field if Branch is selected
if(!isNullOrEmpty(supplier))
msgField.setDisplayType('hidden');
// demandB
// demandB
supplierField.setLayout Type('startrow');
if(isNullOrEmpty (branch)){
}
nlapiLogExecution ('debug', 'Setting planner', 'Setting planner field');
setPlannerField (plannerField, supplier, branch);
potoField.addSelectOption ('', '');
Transcribed Image Text:var today = (date.getMonth() + 1) + '/' + (date.getDate()) + '/' + (date.getYear() + 1900); var form = nlapiCreateForm ('Demand Order'); form.setScript('customscript_cl_dp_order_items'); form.addSubmit Button('Place Order'); form.addButton('custbutton_altview', form.addButton('custbutton_export_csv', // Show Gap Fill button when you have a specific role if (specialRoles.indexOf(ctx.getRoleId()) > -1 && !isNullOrEmpty (supplier)) { } else { var gapLabel = (gapFill == 'T')? 'Remove Gap Fill' : 'Add Gap Fill'; form.addButton('custbutton_gapfill', gapLabel, 'addGapFill'); var demandLabel = (altDemand == 'T') ? 'Use OG Demand': 'Use Demand B'; form.addButton('custbutton_altdemand', demandLabel, 'changeDemand'); 'Change View', 'changeView'); 'Export to CSV', 'exportCSV'); gapFill= 'F'; { } var branchField = form.addField ('custpage_branch', 'select', 'Branch').setLayout Type('normal', 'startcol').setMandatory(false); var dateField = form.addField('custpage_date', 'date', 'Order Date').setMandatory (true); } var msgField = form.addField('custpage_message', 'inlinehtml', 'Message'); var supplierField = form.addField ('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayout Type('startrow'); var supplierLeadField = form.addField ('custpage_supplier_lead_time', 'text', 'Supplier Lead Time').setDisplayType('hidden'); var potoField = form.addField('custpage_po_or_to', 'select', 'PO/TO').setDisplayType('hidden'); var qtyField = form.addField ('custpage_qty', 'integer', 'Total Qty.').setDisplayType('inline').setLayout Type('normal', 'startcol'); var weightField = form.addField ('custpage_weight', 'integer', 'Total Weight').setDisplayType('inline'); var itemField = form.addField ('custpage_item', 'select', 'Item', 'inventoryitem'); var reorderField = form.addField ('custpage_reorder', 'checkbox', 'At or below reorder'); var reorderPointCalcField = form. addField ('custpage_reorder_calc', 'text', 'Reorder Point Calculation (Only Applies to Auto)').setDisplayType('inline').set Layout Type ('normal', 'startcol'); var stockLevelCalcField = form.addField ('custpage_stock_level_calc', 'text', 'Preferred Stock Level Calculation (Only Applies to Auto)').setDisplayType('inline') var plannerField = form.addField ('custpage_planner', 'select', 'Planner', 'employee').setDisplayType('inline'); var savedField = form.addField ('custpage_selected_lines', 'longtext', 'Selected IDs').setDisplayType('hidden'); var submitField = form.addField ('custpage_submit', 'checkbox', 'Ready to Submit').setDisplayType('hidden'); var viewField = form.addField ('custpage_altview', 'checkbox', 'Alt View').setDisplayType('hidden'); var gapField = form.addField('custpage_gapfill', 'checkbox', 'Gap Fill').setDisplayType('hidden'); var altDemandField = form.addField('custpage_altdemand', 'checkbox', 'Alt Demand View').setDisplayType('hidden'); // demandB // Hide "select a supplier" message when the supplier has been selected and set Planner field if Branch is selected if(!isNullOrEmpty(supplier)) msgField.setDisplayType('hidden'); // demandB // demandB supplierField.setLayout Type('startrow'); if(isNullOrEmpty (branch)){ } nlapiLogExecution ('debug', 'Setting planner', 'Setting planner field'); setPlannerField (plannerField, supplier, branch); potoField.addSelectOption ('', '');
Demand Order
Place Order
BRANCH
C7702 - Houston
ORDER DATE*
8/25/2022
** To begin, select a supplier
SUPPLIER
- New -
105 AtlasBX Co., LTD
1230 - APEX
1240 - BE
1250 - BSI
1260 - BX
Export to CSV
Transcribed Image Text:Demand Order Place Order BRANCH C7702 - Houston ORDER DATE* 8/25/2022 ** To begin, select a supplier SUPPLIER - New - 105 AtlasBX Co., LTD 1230 - APEX 1240 - BE 1250 - BSI 1260 - BX Export to CSV
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
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