Method Community

 

JournalEntry and JournalEntryLines not able to retrieve?

Last post 07-13-2024 10:00 AM by v.cameron. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-11-2024 9:06 PM

    JournalEntry and JournalEntryLines not able to retrieve?

    I've been trying to query journal entries from QuickBooks Online using the Method API. I've created a sort of generic function to query the table in Google Apps Script and copy the data to a sheet.

    This code works fine for other tables (like Account, Invoice, etc), but for some reason doesn't work for either JournalEntry or JournalEntryLines. The error is just that the response is blank. Ultimately I want to be able to create new journals as well as query them.

    Any idea what's going on here? Why is the response blank?

    function outputTable() {
      var tblName = 'JournalEntry';
      var pageCount = 5;
      var url = 'https://rest.method.me/api/v1/tables/';
      var addon = '?skip=1'
      url = url + tblName + addon;

      var sheetName = 'Method_' + tblName;
      var sheet = SpreadsheetApp.openById(spreadsheetId).getSheetByName(sheetName);
      var headersDone = false;
     
      var headers = {
        'Authorization': methodApiKey
      };

      var options = {
        'method': 'get',
        'headers': headers,
        'muteHttpExceptions': true
      };

      sheet.clear();
      var allRows = [;
     
      do {
        var response = UrlFetchApp.fetch(url, options);

        if(response.getResponseCode() === 200) {
          var tableData = JSON.parse(response.getContentText());

          if (headersDone == false) {
            headersDone = true;
            var headerRow = [;
            for (var key in tableData.value[0]){
              headerRow.push(key);
            }
            allRows.push(headerRow);
          }

          for (var i = 0; i < tableData.value.length; i++) {
            var thisRow = tableData.value[i];
            var rowData = [;      
            for (var key in thisRow) {
              rowData.push(thisRow[key]);
            }
            allRows.push(rowData);
          }

          // Append rows within the loop
          sheet.getRange(sheet.getLastRow() + 1, 1, allRows.length, allRows[0].length).setValues(allRows);
          // Flush changes
          SpreadsheetApp.flush();
         
          // Clear allRows for the next iteration
          allRows = [;

        } else {
          Logger.log('Error: ' + response.getResponseCode() + ' - ' + response.getContentText());
        }

        pageCount = pageCount - 1;

        url = tableData.nextLink;
      } while ((tableData.nextLink != null) && pageCount != 0);
    }
  • 07-11-2024 11:05 PM In reply to

    Re: JournalEntry and JournalEntryLines not able to retrieve?

    Method does not sync Journal entries with QuickBooks Online, sadly.  The table is there because they did with QuickBooks Desktop but it will always be empty in an account connected to QBO.  You may find this list of supported/synced tables helpful.

    Victoria Cameron
    vcameron@cloudconsutlancyllc.com
    www.cloudconsultancyllc.com
    650/209-0345

    What is Method?


  • 07-12-2024 4:26 PM In reply to

    Re: JournalEntry and JournalEntryLines not able to retrieve?

    Oh no. That's a huge bummer. Expense/Purchase also not supported, so there's literally no way to send a debit P&L transaction to QBO? only credits? Man that stinks.

    Thank you for the response. None of the help documentation searches I came up with showed that info, so I appreciate it.

  • 07-13-2024 10:00 AM In reply to

    Re: JournalEntry and JournalEntryLines not able to retrieve?

    Only Bills and Bill Lines can siync expenses to MethodAlthought I've gotten tricky with some $0Invoices for things I'd normally use JEs for.

    And yes I agree, it is really a blind spot.  Particularly when you've been customizing Method as long as I have and remember being able to send all those things to QuickBooks Desktop.

    Victoria Cameron
    vcameron@cloudconsutlancyllc.com
    www.cloudconsultancyllc.com
    650/209-0345

    What is Method?


Page 1 of 1 (4 items)