Reopen a Closed Work Order in NetSuite

NetSuite's native UI does not allow a user to reopen a closed work order. This causes issues if a user with proper permission preemptively closes a work order.

To reopen a closed work order, go to 'Customization' > 'Scripting' > 'Script Debugger' and paste this script:

var o = nlapiLoadRecord("workorder", 2433031);
for (var i = 1; i <= o.getLineItemCount("item"); i++)
   o.setLineItemValue("item", "isclosed", i, "F");
var stat = nlapiSubmitRecord(o);

o = nlapiLoadRecord("workorder", 2433031);
var x = 1;

Quick Tips Before Running:

  • Substitute the correct work order internal ID value in the two bolded areas. You may have to create a saved search to pull the work order's internal ID.

  • Additionally, the script must run in API Version 1.0.

After the script runs, the work order should return to the 'Released' state from the 'Closed' state.

Disclaimer: Full credit to scotthung who wrote this script. I've included it on this blog to reference and preserve it for myself. Scotthung's original blog post can be found here.

Last Updated: 4/24/23