Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267382
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:53:30+00:00 2026-05-21T06:53:30+00:00

Any QBFC developers out there? I’m using QBFC to pull multiple different types of

  • 0

Any QBFC developers out there? I’m using QBFC to pull multiple different types of objects out of Quickbooks: Customers, Items, Invoices, TaxCodes, etc. The data query code really only varies once you get to the Ret object so I’m trying to build some functions to abstract the process.

A typical repose object looks like

IReponseList
    IResponse
         RetList
             Ret

IResponseList and IResponse are both generic enough to work on all query response types. However, there doesn’t appear to be a generic RetList and Ret Interface that I can use for the abstraction. I only have type-sepecific interfaces like ICustomerRetList, ISalesTaxCodeRetList, etc. I’d like to write the code independent of what TYPE of return list it is….

Is there an interface for RetList or Ret that I just can’t seem to find?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:53:31+00:00Added an answer on May 21, 2026 at 6:53 am

    The interface IQBBase is the closest thing to what you’re looking for. Most everything in QBFC is derived from IQBase, including all query types and all return types. Using IQBBase references and .NET generics it is possible to create a framework to deal with query results.

    Update: the iterator example below is now available as part of the Zombie library for QBFC, which you can grab from github.

    For example, here’s a generic iterator that takes the RetList type and Ret type as parameters:

    /// <summary>
    /// This generic class simplifies and standardizes iteration syntax
    /// for QBFC lists.  Using this class we can use the foreach keyword
    /// to iterate across all items in a list.
    /// </summary>
    /// <typeparam name="L">The type of the list, for example IBillRetList</typeparam>
    /// <typeparam name="D">The type of the item, for example IBillRet</typeparam>
    public class QBFCIterator<L, D>:IEnumerable<D> where L : class, IQBBase
    {
    
        private L m_List;
    
        /// <summary>
        /// This constructor can be used for response list items or for sub-lists that are properties
        /// on other QBFC objects.
        /// </summary>
        /// <param name="lst">The sub-list</param>
        public QBFCIterator(IQBBase lst)
        {
            m_List = lst as L;
    
            if (m_List == null && lst != null)
            {
                throw new Exception("iterator type mismatch");
            }
        }
    
        public bool IsEmpty
        {
            get
            {
                if (m_List == null)
                {
                    return true;
                }
                else
                {
                    return Count == 0;
                }
            }
        }
    
        /// <summary>
        /// An efficient alternative to the Count() function
        /// </summary>
        public int EntityCount
        {
            get { return Count; }
        }
    
        public D GetFirstItem()
        {
            if (IsEmpty)
            {
                throw new Exception("Cannot retrieve item from empty list");
            }
            else
            {
                return GetAt(0);
            }
        }        
    
        #region Late-bound properties
        //
        // Since .NET requires that all methods invoked on a parameterized type
        // must compile based solely on interface constraints, we must use late
        // binding to access the count property and GetAt methods.  This may have 
        // an impact on performance and could conceivably cause run time errors 
        // with incorrect type parameters.
        //
        private int Count
        {
            get
            {
                if (m_List == null)
                {
                    return 0;
                }
                else
                {
                    Type t = m_List.GetType();
    
                    return (int)t.InvokeMember("Count",
                        System.Reflection.BindingFlags.GetProperty, null, m_List, null);
                }
            }
        }
    
        private D GetAt(int idx)
        {
            Type t = m_List.GetType();
    
            return (D)t.InvokeMember("GetAt", 
                System.Reflection.BindingFlags.InvokeMethod, null, m_List, new Object[] { idx });
        }
    
        #endregion
    
        #region IEnumerable<D> Members
    
        public IEnumerator<D> GetEnumerator()
        {
            if (m_List != null)
            {
                for (int idx = 0; idx < Count; idx++)
                {
                    yield return GetAt(idx);
                }
            }
        }
    
        #endregion
    
        #region IEnumerable Members
    
        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            if (m_List != null)
            {
                for (int idx = 0; idx < Count; idx++)
                {
                    yield return GetAt(idx);
                }
            }
        }
    
        #endregion
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any suggestions? Using visual studio in C#. Are there any specific tools to use
I'm using QBFC to generate invoices in a Quickbooks integrating app. I'm getting an
Any Assumption or rule is there, when we can use DataTrigger and when we
any insight as to making/optimizing full-text searches on bigtable using java? best practices and
There doesn't seem to be any tried and true set of best practices to
Any personal experience in overcoming web application performance hurdles? Any recommended strategies for improving
Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept
Any good suggestions? Input will be the name of a header file and output
Any ideas on how to implement tab completion for a .NET (C#) Console Application?
any idea how if the following is possible in PHP as a single line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.