title: Get the name of a sublist in Netsuite?
body: <p>Is there a way to get the name of a sublist in Netsuite? I am using the new Inbound Shipment section, and I need to add items to it via a restlet. Every time I try, I get this error: </p>
  
  <p><code>{"type":"error.SuiteScriptError","name":"SSS_INVALID_SUBLIST_OPERATION","message":"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.","stack":["anonymous(N/recordService)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:57)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"cause":{"type":"internal error","code":"SSS_INVALID_SUBLIST_OPERATION","details":"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.","userEvent":null,"stackTrace":["anonymous(N/recordService)","&lt;anonymous&gt;(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:57)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"notifyOff":false},"id":"","notifyOff":false}"</code></p>
  
  <p>This is how I am trying to access it:</p>
  
  <pre><code>var rec =
              r.create({
                  type: "inboundshipment",
                  isDynamic: true,
                  defaultValues: null
              }).setValue({
                  fieldId: "externalid",
                  value: e.id,
                  ignoreFieldChange: false
              });
  
          var i = 1;
  
          /******/
          //Here is where you are adding a new line.
          /******/
          rec.selectNewLine({
              sublistId: 'item'
          });
          rec.setCurrentSublistValue({
              sublistId: 'item',
              fieldId: 'po',
              value: "13193"
          });
          rec.setCurrentSublistValue({
              sublistId: 'item',
              fieldId: 'item',
              value: "79760"
          });
          rec.setCurrentSublistValue({
              sublistId: 'item',
              fieldId: 'quantity',
              value: 2
          });
  </code></pre>
  
  <p>I think the sublist id might be incorrect, but I can't figure out what it should be. I have tried items, inbounditems, inboundshipmentitems, and all of them give me the same error. I tried to create a sales order in the same fashion and tried to add items to it, and it worked properly, so I am thinking it is just the sublist id. Anyone know how to help?</p>