One of the options you have for an invoice is to use a specially encoded PDF file (through the Invoice object's Body field). Once you have that invoice in the system, you may wish to query on that field. This use case provides information on doing so.
To query an Invoice object's Body field,
SELECT Id, AccountId, Amount, Balance, DueDate, InvoiceDate, InvoiceNumber, Status, TargetDate, Body FROM Invoice WHERE id='someInvoiceId'
Invoice in = query("select Id, AccountId, Amount, Balance, DueDate, InvoiceDate, InvoiceNumber, Status, TargetDate, Body from Invoice where id='someInvoiceId'"); String str = in.getBody(); byte[] b = Base64.decodeBase64(str.getBytes()); File file = new File(in.getInvoiceNumber()+".pdf"); if (!file.exists()) file.createNewFile(); FileOutputStream out = new FileOutputStream(file); out.write(b); out.close();
Copyright © 2008-2009 Zuora, Inc.