Skip to content
pkpjpm edited this page Apr 25, 2012 · 2 revisions

The QBFC library was developed by Intuit to make it easier to program the QuickBooks SDK: QBFC handles all the details of constructing and decoding qbXML messages and has support for advanced features like iterators and error recovery. Unfortunately, QBFC itself can be challenging. In particular, coding a simple program with QBFC requires some special knowledge and care for connection management and accessing data values.

One of the core design goals of Zombie was to make it simple to create simple QBFC applications. The following code sample demonstrates how far we've come towards this goal. This shows the full implementation for a Zombie console application that writes a customer list:

ConnectionMgr.InitDesktop("Zombie demonstration console application");

StatusMgr.AddListener(new StatusConsole(), true);

using (var cn = ConnectionMgr.GetConnection())
{
    var batch = cn.NewBatch();

    var qryCust = batch.MsgSet.AppendCustomerQueryRq();

    batch.SetClosures(qryCust, b =>
    {
        var customers = new QBFCIterator<ICustomerRetList, ICustomerRet>(b);

        foreach (var customer in customers)
        {
            Console.WriteLine(Safe.Value(customer.FullName));
        }
    }); 

    batch.Run();                    
}

If you've had any experience with QBFC, you'll know that this is many fewer lines that would typically be written to query for a customer list.

Clone this wiki locally