0
var field = form.addField(CONST_ICFILTERLIST_FIELD_ID, 'select',
                         'Insight Community Filter List', 'Filters');
field.setLayoutType('midrow', 'startrow');
field.setDisplaySize( 400, 15);

Filters is the Field Group I am trying to add this list into. But the list always shows up at the bottom of the page. How can I put it correctly ?

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Bhakti K
  • 25
  • 1
  • 5

2 Answers2

5

You need to use the name of the field list not the label. e.g.

The field group in your example looks like something custom. It will either have an explicit id (if added by code) or an implicit id assigned by Netsuite (discoverable by inspecting the ui). In the sample below 'custpage_order_grp' is the field group id and 'Pull Orders' is its label.

var ordersGrp = myForm.addFieldGroup('custpage_order_grp', 'Pull Orders');
var myField = myForm.addField('custpage_order_status', 'text', 'Status', null, 'custpage_order_grp');

As Michoel observed if you are trying to insert your new field before an existing field then you'll also have to use the insertField call.

myForm.insertField(myField, 'insertbeforeFieldId');
bknights
  • 14,408
  • 2
  • 18
  • 31
  • Thanks so much ! This worked perfectly well.. do you have an idea about how to insert space before a field thru suite script ? Also, I could not figure id of the fieldgroup, only label was displayed on UI, any ideas there too ? – Bhakti K Aug 10 '15 at 18:48
0

I've found you have to use field.insertField() to place the field where you want.

michoel
  • 3,725
  • 2
  • 16
  • 19