title: Keep getting an error when trying to submit an Inbound Shipment via Netsuite Restlet
body: <p>I keep getting the following error when trying to create a new Inbound Shipment record (new in Netsuite). </p>
  
  <pre><code>{"type":"error.SuiteScriptError","name":"USER_ERROR","message":"Please enter value(s) for: Item","stack":["anonymous(N/recordService)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:132)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:99)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"cause":{"type":"internal error","code":"USER_ERROR","details":"Please enter value(s) for: Item","userEvent":null,"stackTrace":["anonymous(N/recordService)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:132)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:99)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"notifyOff":false},"id":"","notifyOff":false} 
  </code></pre>
  
  <p>Here is the code I have to set the record. I have verified that the sublist id is "items" and the fieldId is "itemid", but when I try to add the line, I get the above error. </p>
  
  <pre><code>function doPost(restletBody){
  log.debug('Called from POST', restletBody);
  
  var success = [],
  errors = [];
  
  restletBody.data.forEach(function(e) 
  {
      try 
      {
          log.debug('Called from POST', e.id);
  
          //Create a new record
          var rec =
              r.create({
                  type: "inboundshipment",
                  isDynamic: true,
                  defaultValues: null
              }).setValue({
                  fieldId: "externalid",
                  value: e.id,
                  ignoreFieldChange: false
              });
  
          var i = 1;
  
      e.lineitems.items.forEach(function(item)
          {
              log.debug("Inside Line Items", item.itemid + " " + item.purchaseorder);
  
  
              rec.selectNewLine({sublistId:"items"});
  
              var field = rec.getSublistFields({
                  sublistId: 'items'
              });
  
              rec.setCurrentSublistValue({
                  sublistId: "items",
                  fieldId: "purchaseorder",
                  value: item.purchaseorder,
                  ignoreFieldChange: true
              });
  
              rec.setCurrentSublistValue({
                  sublistId: "items",
                  fieldId: "itemid",
                  value: item.itemid,
                  ignoreFieldChange: true
              });
              log.debug("Inside Line Items", "ITEM Added " + item.itemid );
  
              rec.commitLine({sublistId:"items"});
              log.debug("Inside Line Items", "Line Committed" );
  
              ++i;
          });
  
          rec.save();
      }
      catch(err) 
      {
          var msg = '';
          log.debug("There was an error", err);
      }
  })
  return "";
  </code></pre>
  
  <p>}</p>
  
  <p>I have tried changing the itemid to shipmentitem and id, and it doesn't work. Before, I was getting an error for PO, too, and it was because the name was wrong, but I fixed that (I believe) for the item. </p>
  
  <p>One thing that might be affecting it (not sure) is that the PO list filters the item list. once the user selects the PO in the UI, it will filter the item list to only items on that PO. I have double-checked that the item I am trying to submit belongs to the PO I am trying to submit, but still receiving an error. Any ideas?</p>