We are making good progress on a java code sample. The format will be similar to what we have for C#, but instead of using datasets, the java sample will use class objects.
I ran into lots of issues using the Java CachedDataRows class that prevented me from getting it to work. If anyone is interested, let me know, and perhaps we can continue down the DataRows path.
Here's an example of an invoice search in Java:
JSONObject queryParams = new JSONObject();
queryParams.put( InvoiceSearchObject.Param_IssueDateFrom, LocalDate.of(2003, 1, 1));
queryParams.put(InvoiceSearchObject.Param_IssueDateTo, LocalDate.of(2003, 12, 31));
String[] cols = {
InvoiceSearchObject.Col_Invoice_InvoiceNo,
InvoiceSearchObject.Col_Invoice_IssueDate
};
queryParams.put(InvoiceSearchObject.Param_IncludeCols, cols);
InvoiceSearchObject invoiceSearch = new InvoiceSearchObject(session);
invoiceSearch.search(queryParams);
System.out.println(
String.format(
"Invoice Search Successful, resultcount=%s",
invoiceSearch.getItems().size()
)
);
for (InvoiceSearchItem invoiceSearchItem : invoiceSearch.getItems())
{
System.out.println("invoiceNo = "+invoiceSearchItem.getInvoiceNo());
}
And here's an example of an invoice load:
InvoiceObject invoice = new InvoiceObject(session);
invoice.load(4);
for (InvoiceItem invoiceItem : invoice.getItems())
{
System.out.println("invoiceNo = "+invoiceItem.getInvoiceNo());
for (BookingItem bookingItem : invoiceItem.getBookingItems())
{
System.out.println(" bookingNo = "+bookingItem.getBookingNo());
}
}
code is not ready for testing yet. If anyone is interested, please let me know.
Dan