title: adding SalesOrderItem to SalesOrder in NetSuite SuiteTalk Web Services
body: <p>I am trying to place a simple SalesOrder using NetSuite web services and having zero luck with what I would assume is a very simple process:</p>
  
  <p>First I instantiate my objects for use with the web service:</p>
  
  <pre><code>SalesOrder order = new SalesOrder();
  SalesOrderItemList items = new SalesOrderItemList();
  SalesOrderItem item = new SalesOrderItem();
  </code></pre>
  
  <p>Now you would think I would just look for some method like:</p>
  
  <pre><code>items.Add(item);
  </code></pre>
  
  <p>To create my list of SalesOrderItems but now such method exists, or anything similar that I can seem to wrap my head around.  I have the SuiteTalkWebServices Platform Guide and have read it through and I am stumped.</p>
  
  <p>Any good references for this API?  NetSuites is lacking in my opinion.  I am using C# by the way.</p>
  
  <h2>UPDATE:</h2>
  
  <p>I found this PDF via a google search, huge help:<br>
  <a href="http://www.netsuite.com/portal/partners/integration/download/SuiteTalkWebServicesPlatformGuide_2011.2.pdf" rel="nofollow">http://www.netsuite.com/portal/partners/integration/download/SuiteTalkWebServicesPlatformGuide_2011.2.pdf</a></p>
  
  <p>What threw me was I need to create an Array then then assign that array to the defined object, instead of adding things to it one by one like I assumed.  The entire API works this way, so once you have it down you are good (basic test adding 2 items to an order):</p>
  
  <pre><code>// create sales order
              SalesOrder so = new SalesOrder();
              SalesOrderItem[] orderItemsArray = new SalesOrderItem[2];
  
              for (int i = 0; i &lt; orderItemsArray.Length; i++)
              {
                  SalesOrderItem item = new SalesOrderItem();
                  item.quantity = i;
                  item.description = "test item" + i;
                  item.amount = (double)75.00;
                  orderItemsArray[i] = item;
              }
  
              SalesOrderItemList orderItems = new SalesOrderItemList();
              orderItems.item = orderItemsArray;
              so.itemList = orderItems;
  
              so.orderStatus = SalesOrderOrderStatus._pendingApproval;
              service.add(so);
  </code></pre>
  
  <p>There is more that needs to be done with this but at least this should get anyone going.</p>