I have a project I need assistance with using javascript. I am needing to reverese the view order in which the suppliers are when a user clicks on the Supplier field. For example please see image 1.  Now I found the code that pulls in that table in on that page: See image 2.  The variable: var supplierField = form.addField('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayoutType('startrow');  This is the code and in particular this id: 'customrecord_reorder_suppliers' is pulling in the field values for screen shot 1. However, I am not sure how to change the order view. Currently the order view is: Number Supplier Name => (12344 Walmart) My goal is to change it to: Supplier Name Number =>  (Walmart 12344) I have tried using the built in JS methods like so: 'customrecord_reorder_suppliers'.split(' ').reverse().join(' ') but to no avail. I also created a new variable and reassigned the initial variable and called the same methods on the new variable and it still did not work.  If someone can help me work through this that would be great.

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

I have a project I need assistance with using javascript. I am needing to reverese the view order in which the suppliers are when a user clicks on the Supplier field. For example please see image 1. 

Now I found the code that pulls in that table in on that page: See image 2. 

The variable:

var supplierField = form.addField('custpage_supplier', 'select', 'Supplier', 'customrecord_reorder_suppliers').setLayoutType('startrow'); 

This is the code and in particular this id: 'customrecord_reorder_suppliers' is pulling in the field values for screen shot 1. However, I am not sure how to change the order view.

Currently the order view is: Number Supplier Name => (12344 Walmart)

My goal is to change it to: Supplier Name Number =>  (Walmart 12344)

I have tried using the built in JS methods like so: 'customrecord_reorder_suppliers'.split(' ').reverse().join(' ') but to no avail. I also created a new variable and reassigned the initial variable and called the same methods on the new variable and it still did not work. 

If someone can help me work through this that would be great. 

 

 

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 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Thank you for your response. I was wanting to know how do I do it with the exisiting script in the screen shot? This is on NetSuite which is an Oracle product. The field values are coming from a record table that was created in NetSuite and it is a string datatype. 

Solution
Bartleby Expert
SEE SOLUTION
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