title: How to update Purchase order record in netsuite
body: <p>I am trying to update a purchase order record in netsuite from my webservices request.</p>
  
  <p>Instead of updating the record it adds a new record with same details of previous record.</p>
  
  <p>For example I have added one record for an item with quantity 150, now I want to update this quantity to 200. when I done update operation observed that there is two records one with 150 and another with 200. Here is the code. Where am I doing wrong?</p>
  
  <pre><code>PurchaseOrder po=new PurchaseOrder();
  RecordRef rf=new RecordRef();
  rf.setInternalId("1683");
  po.setEntity(rf);
  Calendar trandate=Calendar.getInstance();
  
  po.setTranDate(trandate);
  po.setCurrencyName("USA");
  RecordRef rf1=new RecordRef();
  rf1.setName("Primary Purchase Order");
  po.setCustomForm(rf1);
  
  CustomFieldList  cfl=new CustomFieldList();
  CustomFieldRef[] cfr=new CustomFieldRef[3];
  cfr[0]=new StringCustomFieldRef("5391","custbody23", "zy-vnd-103");
  ListOrRecordRef listOrRecordRef1=new ListOrRecordRef();
  listOrRecordRef1.setName("Transportation Method");
  listOrRecordRef1.setInternalId("1");
  
  ListOrRecordRef listOrRecordRef2=new ListOrRecordRef();
  listOrRecordRef2.setName("Delivery Incoterm");
  listOrRecordRef2.setInternalId("1");
  
  cfr[1]=new MultiSelectCustomFieldRef("5392","custbody24",new ListOrRecordRef[]{listOrRecordRef1});
  cfr[2]=new MultiSelectCustomFieldRef("5393","custbody25",new ListOrRecordRef[]{listOrRecordRef2});
  cfl.setCustomField(cfr);
  po.setCustomFieldList(cfl);
  RecordRef rf2=new RecordRef();
  rf2.setName("22:London");
  rf2.setInternalId("10");
  po.setLocation(rf2);
  Double exchangeRate=1.0;
  po.setExchangeRate(exchangeRate);
  PurchaseOrderItemList poil=new PurchaseOrderItemList();
  PurchaseOrderItem[] item=new PurchaseOrderItem[1];
  item[0]=new PurchaseOrderItem();
  RecordRef rf3=new RecordRef();
  rf3.setName("ACC05");
  rf3.setInternalId("1070");
  item[0].setItem(rf3);
  item[0].setRate("15.28");
  double qty=50.0;
  item[0].setQuantity(qty);
  double amt=764.0;
  item[0].setAmount(amt);
  Calendar expectedReceiptDate=Calendar.getInstance();
  expectedReceiptDate.add(Calendar.DATE,7);
  item[0].setExpectedReceiptDate(expectedReceiptDate);
  poil.setItem(item);
  po.setItemList(poil);
  
  po.setBillAddress("hi&lt;br&gt;unitedstates&lt;br&gt;CA");
  po.setInternalId("6306");
  
  WriteResponse writeRes = _port.update(po);
  </code></pre>