Work Order Close

If the Manufacturing Work In Process (WIP) feature has been enabled, you can use SOAP web services to interact with work order close records. You can verify whether WIP is enabled by going to Setup > Company > Enable Features, and reviewing the Items & Inventory tab.

With WIP, instead of creating a single assembly build record to denote that a work order has been addressed, you track progress of the work using three records: work order issue, work order completion, and work order close. This approach lets you manage the assembly process in a more granular way, and to keep the General Ledger up to date as materials move through the different phases of assembly. For more on the benefits of WIP, see Manufacturing Work In Process (WIP).

The work order close record is used to indicate that all accounting variances that might have arisen during the assembly process have been resolved. In the UI, you can view the form used for creating this record by viewing the work order and clicking the Close button.

The work order issue record is defined in the tranInvt (inventory) XSD.

Supported Operations

The following operations can be used with work order close records:

add | addList | attach / detach | delete | deleteList | get | getDeleted | getList | getSavedSearch | initialize / initializeList | search | update | updateList | upsert | upsertList

Note:

You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s work order close reference page.

Note:

For information about using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

Refer to the following sections for more details on interacting with work order close records.

Prerequisites for Creating a Record

Before you can create a work order close record, a work order record must already exist, and the work order must be configured to use WIP (the WIP box on the work order record must be selected). This is true regardless of whether you are creating the work order close record using initialize and add, or add by itself. If you try to create a work order close record referencing a work order that has not been configured to use WIP, the system generates an error reading in part, “One of the following problems exists: You have an invalid work order < work order ID >, the work order does not use WIP, or the work order is already closed.”

You can create and modify work orders by choosing Transactions > Manufacturing > Enter Work Orders. You can also interact with work orders using SOAP web services, as described in Work Order.

It does not matter if a work order issue record or a work order completion exists for your work order. You can go straight from entering the work order to creating the work order close record.

Using Initialize Versus Add

You can initialize a work order close record from a Work Order record. This is the preferred approach, though you can also create the record using the add operation by itself.

The initialize operation emulates the UI workflow by prepopulating fields on transaction line items with values from a related record. For more information about this operation, see initialize / initializeList.

If you are using the add operation by itself, note that you must use the createdFrom field to identify the appropriate work order. If you fail to set a value for this field, the system generates an error reading, “Transaction can only be created from a work order.”

The ComponentList Sublist Is Not Returned During a Get

Note that the componentList sublist is not exposed, so performing a get operation on the work order close record will not include the items. This is true even though you can view the sublist in the UI when you display the work order close record there. The sublist is read only, and read-only sublists generally are not exposed.

Sample Code

The following code illustrates how to add a work order close record using a few different techniques.

Using Initialize

This example shows how to create a work order close record using both the initialize and add operations, which is the preferred approach. Note that this technique results in two SOAP requests and two SOAP responses.

Java
          InitializeRef initRef = new InitializeRef();
initRef.setType(InitializeRefType.workOrder);
initRef.setInternalId("167");
 
WorkOrderClose woRecord = (WorkOrderClose) c.initialize(initRef,InitializeType.workOrderClose,null);
 
c.addRecord(woRecord); 

        
SOAP Request (Initialize)
          <soapenv:Body>  
   <initialize xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
      <initializeRecord>    
         <ns7:type xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com">workOrderClose</ns7:type>    
         <ns8:reference internalId="167" type="workOrder" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>   
      </initializeRecord>  
   </initialize> 
</soapenv:Body> 

        
SOAP Response (Initialize)
          <soapenv:Body>
   <initializeResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <readResponse>
         <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
         <record xsi:type="tranInvt:WorkOrderClose" xmlns:tranInvt="urn:inventory_2017_1.transactions.webservices.netsuite.com">
            <tranInvt:createdDate>2013-03-07T07:10:00.000-08:00</tranInvt:createdDate>
            <tranInvt:lastModifiedDate>2013-03-07T08:25:00.000-08:00</tranInvt:lastModifiedDate>
            <tranInvt:tranId>1</tranInvt:tranId>
            <tranInvt:item internalId="247" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:name>JS Assembly Item Y</platformCore:name>
            </tranInvt:item>
            <tranInvt:orderQuantity>5.0</tranInvt:orderQuantity>
            <tranInvt:createdFrom internalId="167" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:name>Work Order #1</platformCore:name>
            </tranInvt:createdFrom>
            <tranInvt:tranDate>2013-03-07T00:00:00.000-08:00</tranInvt:tranDate>
            <tranInvt:postingPeriod internalId="141" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:name>Mar 2013</platformCore:name>
            </tranInvt:postingPeriod>
            <tranInvt:subsidiary internalId="3" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:name>SUB  UK</platformCore:name>
            </tranInvt:subsidiary>
            <tranInvt:location internalId="2" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:name>Location UK</platformCore:name>
            </tranInvt:location>
            <tranInvt:customFieldList xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:customField internalId="43" scriptId="custbody_633637_bsubmit" xsi:type="platformCore:BooleanCustomFieldRef">
                  <platformCore:value>false</platformCore:value>
               </platformCore:customField>
               <platformCore:customField internalId="165" scriptId="custbody_633637_bload" xsi:type="platformCore:BooleanCustomFieldRef">
                  <platformCore:value>false</platformCore:value>
               </platformCore:customField>
               <platformCore:customField internalId="65" scriptId="custbody_633637_asubmit" xsi:type="platformCore:BooleanCustomFieldRef">
                  <platformCore:value>false</platformCore:value>
               </platformCore:customField>
            </tranInvt:customFieldList>
         </record>
      </readResponse>
   </initializeResponse>
</soapenv:Body> 

        
SOAP Request (Add)
          <soapenv:Body>  
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
      <record xsi:type="ns7:WorkOrderClose" xmlns:ns7="urn:inventory_2017_1.transactions.webservices.netsuite.com">    
         <ns7:createdDate xsi:type="xsd:dateTime">2013-03-07T15:10:00.000Z</ns7:createdDate>    
         <ns7:lastModifiedDate xsi:type="xsd:dateTime">2013-03-07T16:25:00.000Z</ns7:lastModifiedDate>    
         <ns7:tranId xsi:type="xsd:string">1</ns7:tranId>    
         <ns7:item internalId="247" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com">     
            <ns8:name xsi:type="xsd:string">JS Assembly Item Y</ns8:name>    
         </ns7:item>    
         <ns7:orderQuantity xsi:type="xsd:double">5.0</ns7:orderQuantity>    
         <ns7:createdFrom internalId="167" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com">     
            <ns9:name xsi:type="xsd:string">Work Order #1</ns9:name>    
         </ns7:createdFrom>    
         <ns7:tranDate xsi:type="xsd:dateTime">2013-03-07T08:00:00.000Z</ns7:tranDate>    
         <ns7:postingPeriod internalId="141" xsi:type="ns10:RecordRef" xmlns:ns10="urn:core_2017_1.platform.webservices.netsuite.com">     
            <ns10:name xsi:type="xsd:string">Mar 2013</ns10:name>    
         </ns7:postingPeriod>    
         <ns7:subsidiary internalId="3" xsi:type="ns11:RecordRef" xmlns:ns11="urn:core_2017_1.platform.webservices.netsuite.com">     
            <ns11:name xsi:type="xsd:string">SUB  UK</ns11:name>    
         </ns7:subsidiary>    
         <ns7:location internalId="2" xsi:type="ns12:RecordRef" xmlns:ns12="urn:core_2017_1.platform.webservices.netsuite.com">        
            <ns12:name xsi:type="xsd:string">Location UK</ns12:name>    
         </ns7:location>    
         <ns7:customFieldList xsi:type="ns13:CustomFieldList" xmlns:ns13="urn:core_2017_1.platform.webservices.netsuite.com">     
            <ns13:customField scriptId="custbody_633637_bsubmit" xsi:type="ns13:BooleanCustomFieldRef">
               <ns13:value xsi:type="xsd:boolean">false</ns13:value>     
            </ns13:customField>   
            <ns13:customField scriptId="custbody_633637_bload" xsi:type="ns13:BooleanCustomFieldRef">   
               <ns13:value xsi:type="xsd:boolean">false</ns13:value>     
            </ns13:customField>
            <ns13:customField scriptId="custbody_633637_asubmit" xsi:type="ns13:BooleanCustomFieldRef">
               <ns13:value xsi:type="xsd:boolean">false</ns13:value>     
            </ns13:customField> 
         </ns7:customFieldList>
      </record>
   </add>
</soapenv:Body> 

        
SOAP Response (Add)
          <soapenv:Body>
   <addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <writeResponse>
         <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
         <baseRef internalId="270" type="workOrderClose" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Using Add

This example shows how to create a work order close record using the add operation alone.

Java
          RecordRef createdFromRef = new RecordRef();
createdFromRef.setInternalId("167");
 
RecordRef postingPeriodRef = new RecordRef();
postingPeriodRef.setInternalId("141");
 
RecordRef departmentRef = new RecordRef();
departmentRef.setInternalId("2");
 
RecordRef classRef = new RecordRef();
classRef.setInternalId("2");
 
WorkOrderClose newWOCl = new WorkOrderClose();
newWOCl.setExternalId("WOCl-JS-001-TEST");
newWOCl.setTranId("TEST WOCl #1");
newWOCl.setCreatedFrom(createdFromRef);
newWOCl.setPostingPeriod(postingPeriodRef);
newWOCl.setDepartment(departmentRef);
newWOCl.set_class(classRef);
newWOCl.setMemo("Memo text");
 
c.addRecord(newWOCl); 

        
SOAP Request
          <soapenv:Body>  
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
      <record externalId="WOCl-JS-001-TEST" xsi:type="ns6:WorkOrderClose" xmlns:ns6="urn:inventory_2017_1.transactions.webservices.netsuite.com">    
         <ns6:tranId xsi:type="xsd:string">TEST WOCl #1</ns6:tranId>    
         <ns6:createdFrom internalId="167" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>    
         <ns6:postingPeriod internalId="141" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>    
         <ns6:memo xsi:type="xsd:string">Memo text</ns6:memo>    
         <ns6:department internalId="2" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>    
         <ns6:class internalId="2" xsi:type="ns10:RecordRef" xmlns:ns10="urn:core_2017_1.platform.webservices.netsuite.com"/>   
      </record>  
   </add> 
</soapenv:Body> 

        
SOAP Response
          <soapenv:Body>
   <addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <writeResponse>
         <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
         <baseRef internalId="269" externalId="WOCl-JS-001-TEST" type="workOrderClose" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Related Topics

Work Order Completion
Multiple Shipping Routes in SOAP Web Services
Transactions
Usage Notes for Transaction Record Types
Multiple Shipping Routes in SOAP Web Services
Transaction Search
How to Use the SOAP Web Services Records Help
SOAP Web Services Supported Records
SOAP Schema Browser
SuiteTalk SOAP Web Services Platform Overview
Assembly Items
Manufacturing Work In Process (WIP)
Entering an Individual Work Order

General Notices