View Categories

Customers

11 min read

  ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get All Customer's name and level only. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomersNamesFromQB(Optional ByRef errorMsg As String = "") As List(Of Customer)
 ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customer Record Count. Returns number of records in QuickBooks
    ''' In case of error returns: will return -1
    ''' </summary>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerRecordCount(Optional ByRef errorMsg As String = "") As Integer
''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get All Customer. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' NOTE: IF YOU HAVE TOO MANY RECORDS GET Customer BY DATERANGE
    ''' </summary>
    ''' <param name="ActiveStatus">qbActiveStatus enum. Values (ActiveOnly [DEFAULT], InactiveOnly, All)</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetAllCustomer(Optional ByVal ActiveStatus As qbActiveStatus = qbActiveStatus.All, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
   ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customer By ListIDs. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' NOTE: IF YOU HAVE TOO MANY RECORDS GET Customer BY DATERANGE
    ''' </summary>
    ''' <param name="ListID">ListID of the Customer.</param>
    ''' <param name="ListIDs">ListIDs of the Customer.</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByListIDs(ByVal ListID As String, Optional ByVal ListIDs As List(Of String) = Nothing, Optional ByVal MaxReturned As Integer = 0, Optional ByRef errorMsg As String = "") As List(Of Customer)
''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customer By FullNames. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' NOTE: IF YOU HAVE TOO MANY RECORDS GET Customer BY DATERANGE
    ''' </summary>
    ''' <param name="FullName">FullName of the Customer</param>
    ''' <param name="FullNames">FullNames of the Customer</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByFullNames(ByVal FullName As String, Optional ByVal FullNames As List(Of String) = Nothing, Optional ByVal MaxReturned As Integer = 0, Optional ByRef errorMsg As String = "") As List(Of Customer)
 ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customers By DateRange. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="FromModifiedDate">FromDate</param>
    ''' <param name="ToModifiedDate">ToDate</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomersByDateRange(ByVal FromModifiedDate As DateTime, ByVal ToModifiedDate As DateTime, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
    ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customers By Name. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="Name">Customer Name</param>
    ''' <param name="MatchCriterion">qbMatchCriterion enum. Values(StartsWith, Contains, EndsWith)</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByName(ByVal Name As String, ByVal MatchCriterion As qbMatchCriterion, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get Customers By NameRange. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="FromName">FromName value</param>
    ''' <param name="ToName">ToName value.</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByNameRange(ByVal FromName As String, ByVal ToName As String, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
  ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get CustomerBy Class ListIDs. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="ListID">Class ListID</param>
    ''' <param name="ListIDs">Class ListIDs</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByClassListIDs(ByVal ListID As String, Optional ByVal ListIDs As List(Of String) = Nothing, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
 ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get CustomerBy Class FullNames. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="FullName">Class FullName</param>
    ''' <param name="FullNames">Class FullNames</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByClassFullNames(ByVal FullName As String, Optional ByVal FullNames As List(Of String) = Nothing, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get CustomerBy Class ListIDWithChildren. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="ListIDWithChildren">Class ListIDWithChildren</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByClassListIDWithChildren(ByVal ListIDWithChildren As String, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
   ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Get CustomerBy Class FullNameWithChildren. Returns List(Of Customer)
    ''' In case of error returns: new List(Of Customer)
    ''' </summary>
    ''' <param name="FullNameWithChildren">Class FullNameWithChildren</param>
    ''' <param name="MaxReturned">max number of records to get</param>
    ''' <param name="BalanceFilter">qbOperator enum. Values (None [DEFAULT], LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual)</param>
    ''' <param name="Balance">The monetary amount to which Operator refers.</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function GetCustomerByClassFullNameWithChildren(ByVal FullNameWithChildren As String, Optional ByVal MaxReturned As Integer = 0, Optional ByVal BalanceFilter As qbOperator = qbOperator.None, Optional ByVal Balance As String = "", Optional ByRef errorMsg As String = "") As List(Of Customer)
    ''' <summary>
    ''' It will delete the record from QuickBooks.
    ''' Once deleted, there is no way to retrieve
    ''' </summary>
    ''' <param name="ListID">to add new records to QB set ListID to a temporal one</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function DeleteCustomerFromQuickBooksByListID(ByVal ListID As String, Optional ByRef errorMsg As String = "") As Boolean
    ''' <summary>
    ''' It will add Customers to QuickBooks.
    ''' Operation field needs to be set update, add, or delete to update QuickBooks
    ''' if the Operation is empty, fields will be skipped
    ''' Returns a List(Of Customer) updated by QuickBooks
    ''' </summary>
    ''' <param name="_Customer">the record that you want to be updated in QuickBooks. Nothing if you want to add a List(of *)</param>
    ''' <param name="_CustomerList">add all the record to the list that you want to be updated in QuickBooks</param>
    Public Function UpdateQuickBooks(ByVal _Customer As Customer, Optional ByVal _CustomerList As List(Of Customer) = Nothing) As List(Of Customer)
''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Starts record-data block. Returns a Queue(Of Customer)
    ''' After calling this method you need to call ContinueRecordAndDataBlock
    ''' In case of error returns: new Queue(Of Customer)
    ''' </summary>
    ''' <param name="MaxReturnedPerRequest">max number of records to get per request</param>
    ''' <param name="TotalRecordNumber">total record number that can be query from QuickBooks</param>
    ''' <param name="ReturnedRecordNumber">record number already returned</param>
    ''' <param name="RemainingRecordNumber">Remaining Record Number after each call</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function StartRecordAndDataBlock(ByVal MaxReturnedPerRequest As Integer, Optional ByRef errorMsg As String = "", Optional ByRef TotalRecordNumber As Integer = 0, Optional ByRef ReturnedRecordNumber As Integer = 0, Optional ByRef RemainingRecordNumber As Integer = 0) As Queue(Of Customer)
  ''' <summary>
    ''' QuickBooks connection needs to be open first.
    ''' Continue record-data block. Returns a Queue(Of Customer)
    ''' Call this method until RemainingRecordNumber zero or less
    ''' In case of error returns: new Queue(Of Customer)
    ''' </summary>
    ''' <param name="TotalRecordNumber">total record number that can be query from QuickBooks</param>
    ''' <param name="ReturnedRecordNumber">record number already returned</param>
    ''' <param name="RemainingRecordNumber">Remaining Record Number after each call</param>
    ''' <param name="errorMsg">returned error message</param>
    Public Function ContinueRecordAndDataBlock(Optional ByRef errorMsg As String = "", Optional ByRef TotalRecordNumber As Integer = 0, Optional ByRef ReturnedRecordNumber As Integer = 0, Optional ByRef RemainingRecordNumber As Integer = 0) As Queue(Of Customer)

Customer

 Public shipToAddressRetList As New List(Of ShipToAddressRet)
    Public additionalContactList As New List(Of AdditionalContact)
    Public contactsRetList As New List(Of ContactsRet)
    Public additionalNotesRetList As New List(Of AdditionalNotesRet)


    Public ListID As String = ""
    Public TimeCreated As String = ""
    Public TimeModified As String = ""
    Public EditSequence As String = ""
    Public Name As String = ""
    Public FullName As String = ""
    Public IsActive As String = ""
    Public ClassRef_ListID As String = ""
    Public ClassRef_FullName As String = ""
    Public ParentRef_ListID As String = ""
    Public ParentRef_FullName As String = ""
    Public Sublevel As String = ""
    Public CompanyName As String = ""
    Public Salutation As String = ""
    Public FirstName As String = ""
    Public MiddleName As String = ""
    Public LastName As String = ""
    Public Suffix As String = ""
    Public PrintAs As String = ""
    Public BillAddress_Addr1 As String = ""
    Public BillAddress_Addr2 As String = ""
    Public BillAddress_Addr3 As String = ""
    Public BillAddress_Addr4 As String = ""
    Public BillAddress_Addr5 As String = ""
    Public BillAddress_City As String = ""
    Public BillAddress_State As String = ""
    Public BillAddress_PostalCode As String = ""
    Public BillAddress_Country As String = ""
    Public BillAddress_Note As String = ""
    Public ShipAddress_Addr1 As String = ""
    Public ShipAddress_Addr2 As String = ""
    Public ShipAddress_Addr3 As String = ""
    Public ShipAddress_Addr4 As String = ""
    Public ShipAddress_Addr5 As String = ""
    Public ShipAddress_City As String = ""
    Public ShipAddress_State As String = ""
    Public ShipAddress_PostalCode As String = ""
    Public ShipAddress_Country As String = ""
    Public ShipAddress_Note As String = ""
    Public Phone As String = ""
    Public Mobile As String = ""
    Public Pager As String = ""
    Public AltPhone As String = ""
    Public Fax As String = ""
    Public Email As String = ""
    Public Contact As String = ""
    Public AltContact As String = ""
    Public CustomerTypeRef_ListID As String = ""
    Public CustomerTypeRef_FullName As String = ""
    Public TermsRef_ListID As String = ""
    Public TermsRef_FullName As String = ""
    Public SalesRepRef_ListID As String = ""
    Public SalesRepRef_FullName As String = ""
    Public Balance As String = ""
    Public OpenBalanceDate As String = ""
    Public TotalBalance As String = ""
    Public SalesTaxCodeRef_ListID As String = ""
    Public SalesTaxCodeRef_FullName As String = ""
    Public ItemSalesTaxRef_ListID As String = ""
    Public ItemSalesTaxRef_FullName As String = ""
    Public SalesTaxCountry As String = ""
    Public ResaleNumber As String = ""
    Public AccountNumber As String = ""
    Public CreditLimit As String = ""
    Public PFDPaymentMethodRef_ListID As String = ""
    Public PFDPaymentMethodRef_FullName As String = ""
    Public CreditCardNumber As String = ""
    Public ExpirationMonth As String = ""
    Public ExpirationYear As String = ""
    Public NameOnCard As String = ""
    Public CreditCardAddress As String = ""
    Public CreditCardPostalCode As String = ""
    Public JobStatus As String = ""
    Public JobStartDate As String = ""
    Public JobProjectedEndDate As String = ""
    Public JobEndDate As String = ""
    Public JobDesc As String = ""
    Public JobTypeRef_ListID As String = ""
    Public JobTypeRef_FullName As String = ""
    Public Notes As String = ""
    Public PriceLevelRef_ListID As String = ""
    Public PriceLevelRef_FullName As String = ""
    Public TaxRegistrationNumber As String = ""
    Public CurrencyRef_ListID As String = ""
    Public CurrencyRef_FullName As String = ""
    Public DeliveryMethod As String = ""
    Public JobTitle As String = ""
    Public Cc As String = ""
    Public PreferredDeliveryMethod As String = ""
    Public CustomField1 As String = ""
    Public CustomField2 As String = ""
    Public CustomField3 As String = ""
    Public CustomField4 As String = ""
    Public CustomField5 As String = ""
    Public CustomField6 As String = ""
    Public CustomField7 As String = ""
    Public CustomField8 As String = ""
    Public CustomField9 As String = ""
    Public CustomField10 As String = ""
    Public CustomField11 As String = ""
    Public CustomField12 As String = ""
    Public CustomField13 As String = ""
    Public CustomField14 As String = ""
    Public CustomField15 As String = ""
    Public ExternalGUID As String = ""
    Public UserData As String = ""
    Public Operation As String = ""

Powered by BetterDocs