Question

I am attempting to issue a check to a vendor through the Intuit.IPP API (Interop.QBFC12) using the following code:

    IMsgSetRequest messageSet = session.CreateMsgSetRequest("US", 7, 0);
    ICheckAdd cheque = messageSet.AppendCheckAddRq();
    cheque.AccountRef.ListID.SetValue(vendor.ListID.GetValue());
    cheque.AccountRef.FullName.SetValue("myAccountName");
    cheque.TxnDate.SetValue(DateTime.Today);

    IMsgSetResponse responseSet = session.DoRequests(messageSet);
    IResponse response = responseSet.ResponseList.GetAt(0);
    responseType = (ENResponseType)response.Type.GetValue();
    if (responseType == ENResponseType.rtCheckAddRq)
        returnMessage = response.StatusMessage;

The resulting response.StatusMessage = "Object 80000005-1374598713 specified in the request cannot be found. " The object ID specified is the ListID I pulled for the vendor.

I'm coding pretty much blind as I'm not finding the IPP documentation very helpful or up to date for version 12.

What am I missing?

Was it helpful?

Solution

This:

cheque.AccountRef.ListID.SetValue(vendor.ListID.GetValue());
cheque.AccountRef.FullName.SetValue("myAccountName");

Is what's causing you the problem.

The AccountRef node is for specifying an Account, not a Vendor. An Account is something from the QuickBooks Chart of Accounts (an "Account" object). A Vendor is something from the vendor list (a "Vendor" object) and they are not interchangable objects.

Since you're already setting an AccountRef/FullName:

cheque.AccountRef.FullName.SetValue("myAccountName");

You don't need to set a AccountRef/ListID.

You should always either set a ListID or a FullName - there's no reason to set both (it's just alternative ways to reference the same object - both are "foreign keys" of sorts to QuickBooks).

What you probably meant to do is set the AccountRef like you meant to, but also set the PayeeEntityRef. For example:

cheque.PayeeEntityRef.ListID.SetValue(vendor.ListID.GetValue());

Also, regarding this:

I'm coding pretty much blind as I'm not finding the IPP documentation very helpful or up to date for version 12.

IPP is an entirely different API from what you're using. The IPP docs aren't going to be useful to you, because it's not anywhere close to the API you're using.

What you should be using for reference is the QuickBooks OSR:

And also the QuickBooks SDK downloadable .EXE, which has a bunch of relevant PDF documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top