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:
First I instantiate my objects for use with the web service:
SalesOrder order = new SalesOrder();
SalesOrderItemList items = new SalesOrderItemList();
SalesOrderItem item = new SalesOrderItem();
Now you would think I would just look for some method like:
items.Add(item);
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.
Any good references for this API? NetSuites is lacking in my opinion. I am using C# by the way.
UPDATE:
I found this PDF via a google search, huge help:
http://www.netsuite.com/portal/partners/integration/download/SuiteTalkWebServicesPlatformGuide_2011.2.pdf
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):
// create sales order
SalesOrder so = new SalesOrder();
SalesOrderItem[] orderItemsArray = new SalesOrderItem[2];
for (int i = 0; i < 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);
There is more that needs to be done with this but at least this should get anyone going.
In Answer to your references question, there are several resources that may help.
I would strongly suggest browsing through the Netsuite Usergroup forum, it has a lot of code examples.