Search code examples
netsuitesuitescript

Set focus on a particular sublist field on a custom form


I have a scenario with a custom form with a main record, and a sublist of items.

I have various criteria, which disable or enable some of the fields in the sublist on the fly. One problem I have is when field #4 for example is filled, it then enables fields #5 - #7. Generally I tab through fields, and since Field #8 is always enabled, after i fill #4, then tab, 5-7 become enabled, but the cursor is already at #8 and I have to back-tab to fields 5-7...

I have tried:

document.getElementById('custrecordcpsi_price1').focus()

But it doesn't work... is there another method to push the cursor to a particular active sublist field?


Solution

  • Unfortunately, NetSuite doesn't have an API that will set the focus on a field or sublist field/column. Please be advised that DOM scripting is not supported by NetSuite's SuiteScript.