Search code examples
quickbooksqbfc

Quickbooks SDK Deposit not populating payee on main deposit


I am creating a program using the QBFC13 that is supposed to create a deposit from an other current asset type of account to a bank account. However, when the depositadd method is executed the payee doesn't get filled in on the bank account. How do i get the Payee information filled out? I dont have a high enough reputation to post pictures so this is a link to the picture of the field i need filled out: https://i.sstatic.net/nqWOh.jpg

Here is my current code:

    Public Sub CreateDeposit()
    On Error GoTo Errs
    Dim depositadd As IDepositAdd
    depositadd = msgSetRequest.AppendDepositAddRq()
    depositadd.DepositToAccountRef.FullName.SetValue("checking")

    depositadd.Memo.SetValue("newdeposit test")
    depositadd.TxnDate.SetValue(Date.Today)



    Dim depositLineAdd As IDepositLineAdd
    depositLineAdd = depositadd.DepositLineAddList.Append()
    depositLineAdd.ORDepositLineAdd.DepositInfo.AccountRef.ListID.SetValue("1EE0000-943382783")
    depositLineAdd.ORDepositLineAdd.DepositInfo.EntityRef.ListID.SetValue("80002534-1335362979")
    depositLineAdd.ORDepositLineAdd.DepositInfo.Amount.SetValue(150.0)
    depositLineAdd.ORDepositLineAdd.DepositInfo.Memo.SetValue("test memo lineitem")


    ' send the request to QB
    Dim msgSetResponse As IMsgSetResponse
    msgSetResponse = qbSessionManager.DoRequests(msgSetRequest)

    ' check to make sure we have objects to access first
    ' and that there are responses in the list
    If (msgSetResponse Is Nothing) Or _
        (msgSetResponse.ResponseList Is Nothing) Or _
        (msgSetResponse.ResponseList.Count <= 0) Then
        Exit Sub
    End If

    ' Start parsing the response list
    Dim responseList As IResponseList
    responseList = msgSetResponse.ResponseList
    MsgBox(msgSetRequest.ToXMLString())
    ' go thru each response and process the response.
    ' this example will only have one response in the list
    ' so we will look at index=0
    Dim response As IResponse
    response = responseList.GetAt(1)
    If (Not response Is Nothing) Then
        If response.StatusCode <> "0" Then
            MsgBox("DepositFunds unexpexcted Error - " & vbCrLf & "StatusCode = " & response.StatusCode & vbCrLf & vbCrLf & response.StatusMessage)
        Else
            MsgBox("The funds were successfully deposited in Checking")
            MsgBox(msgSetResponse.ToXMLString())
        End If
    End If

    Exit Sub

Errs:
        MsgBox("HRESULT = " & Err.Number & " (" & Hex(Err.Number) & ") " & vbCrLf & vbCrLf & Err.Description, _
                MsgBoxStyle.Critical, _
                "Error in DepositFunds")



End Sub

Solution

  • This actually isn't an SDK issue, as it's how QuickBooks was designed. Because a deposit transaction in QuickBooks can contain multiple lines, the bank register won't show any names even if there's just one line. You can manually go to the bank register and add the name, but there's not a way to do it through the SDK. It's a two step process to even do it in QuickBooks, where you create the deposit, then go and edit it in the register.

    If you need to have this information show from transaction using the SDK, then you might have to use Journal Entries instead of a Deposit transaction.