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.
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 ('', '');](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7b9451f1-a2f9-47cb-b8b6-654ac5ea1321%2F124b1aed-2957-43b6-ab1d-b567c16c0154%2Fo0nfu4_processed.png&w=3840&q=75)
![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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7b9451f1-a2f9-47cb-b8b6-654ac5ea1321%2F124b1aed-2957-43b6-ab1d-b567c16c0154%2Fpt66qpw_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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.
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)