Hi,
We currently use the code below to copy out invoices from NS into our own DB but when attempting to read the balance, amount paid and amount remaining on the invoice record these values are always returned as 0 even though the GUI shows the correct values. Please could someone advise of the correct manner of getting there values through webservices.
The search is performed correctly and I can get at all the fields on the returned records, it's just that the balance, amount paid and amount remaining are always returned as 0.
Also, there is no daysOverdue field on the returned record even though this is an available search parameter. Is this something that has to be manually calculated from the duedate?
Thanks
Code...
For the search:
TransactionSearch transSearch = new TransactionSearch(); TransactionSearchBasic transSearchBasic = new TransactionSearchBasic(); SearchDateField lastUpdateDate = new SearchDateField(); lastUpdateDate.predefinedSearchValue = SearchDate.today; lastUpdateDate.predefinedSearchValueSpecified = true; lastUpdateDate.@operator = SearchDateFieldOperator.within; lastUpdateDate.operatorSpecified = true; transSearchBasic.lastModifiedDate = lastUpdateDate; SearchEnumMultiSelectField transType = new SearchEnumMultiSelectField(); transType.searchValue = new String[] { "invoice" }; transType.@operator = SearchEnumMultiSelectFieldOperator.anyOf; transType.operatorSpecified = true; transSearchBasic.type = transType; transSearch.basic = transSearchBasic; SearchResult transactionResponse = ripper._service.search(transSearch);And the code that returns 0 for balance, amount due and amount remaining:public void processInvoiceResults(SearchResult invoiceResponse) { Record[] objInvoicesReturned = invoiceResponse.recordList; foreach (Invoice invoice in objInvoicesReturned) { _out.info(" ***************** START INVOICE ***************** "); _out.info("Netsuite modified: " + invoice.lastModifiedDate); _out.info("Netsuite internalId: " + invoice.internalId); _out.info("Created from: " + invoice.createdFrom.internalId); _out.info("Customer job: " + invoice.entity.name); _out.info("STATUS: " +invoice.status); _out.info("BALANCE: " + invoice.balance); _out.info("AMOUNTOVER: " + invoice.amountRemaining); _out.info("AMOUNTPAID: " + invoice.amountPaid); ...