0

I have using Netsuite Webservice Logic Code. I want to convert Sales order to Invoice .In the below code is working fine but I am seeing unexpected error

NS Invoice Creation Error: Please enter value(s) for Country

Here is my code

Invoice ns_invoice = new Invoice();
InvoiceItem ns_invoive_Item = new InvoiceItem();
InitializeRecord ir = new InitializeRecord();
ir.type = InitializeType.invoice;
InitializeRef iref = new InitializeRef();
iref.type = InitializeRefType.salesOrder;
iref.typeSpecified = true;
iref.internalId = cust_po.netsuite_sales_order_id__c;
ir.reference = iref;
ReadResponse getInitResp = _service.initialize(ir);

Anybody one helps me to resolve it.

Alex
  • 3,689
  • 1
  • 21
  • 32

1 Answers1

0

In NS webservice, fields are dependent on the default form of the transaction(in your case invoice). I would check the default form of the invoice record to see if the Country field is mandatory. If it is mandatory and on your WS call you need to ensure that you have the field filled with a value. If the country field is not mandatory on the form, there might be a script that is doing the check.

vVinceth
  • 905
  • 5
  • 7