How to override tax details in Vendor Bill via SOAP in NetSuite ERP?

165 Views Asked by At

SuiteTax installed and enabled. https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/preface_1496364245.html#SuiteTax

I try to import vendor bill via SOAP web service. Vendor bill has tax details overridden. I always have an error:

[USER_ERROR] Please enter value(s) for: Tax Details Reference, Tax Type, Tax Code, Tax Basis, Tax Rate, Tax Amount (ERROR)

I can import vendor bill via SOAP web service with 1 line of items, for instance. It works well. I can use tax details overriding via NetSuite UI:

  • check tax details override checkbox.
  • set Tax Details Reference, Tax Type, Tax Code, Tax Basis, Tax Rate, Tax Amount
  • NetSuite accept this. Everything is OK.

However, when I try to use SOAP web service to import vendor bill with tax details overridden, I always get an error:

[USER_ERROR] Please enter value(s) for: Tax Details Reference, Tax Type, Tax Code, Tax Basis, Tax Rate, Tax Amount (ERROR)

All fields were filled in. Tax Details Reference was set the same in item and in tax details line. I tried SOAP update procedure to add overridden tax details to well formed vendor bill - the same error.

How to send vendor bill with tax details overridden to NetSuite via SOAP webservice.

1

There are 1 best solutions below

0
On

I have found what went wrong. I forgot about special fields that work in pair with usual plain type field (string, int, double ...). It's:

fieldNameSpecified

These fields must be set to TRUE.

Here is an example of source code for SuiteTalk C# SOAP web service:

vendorBill.taxDetailsList = new TaxDetailsList();
vendorBill.taxDetailsOverride = true;
vendorBill.taxDetailsOverrideSpecified = true;
vendorBill.taxDetailsList.replaceAll = true;
vendorBill.taxDetailsList.taxDetails = new[]
{
   new TaxDetails()
   {
      taxDetailsReference = taxDetailsRef,
      taxRate = 10,
      taxRateSpecified = true,

      taxAmount = 1,
      taxAmountSpecified = true,
      taxCode = new RecordRef()
      {
         internalId = "528",

      },
      taxType = new RecordRef()
      {
         internalId = "35",
      },

      taxBasis = 5,
      taxBasisSpecified = true
   }
};