Class QBFC::List
In: lib/qbfc/list.rb
Parent: Element

List objects are those with names, such as Accounts, Entities, and Items.

Note on the name: it doesn‘t make sense since a List is actually a single object, but it fits with the SDK‘s naming scheme, and I couldn‘t think of a better one.

Methods

Constants

ID_NAME = "ListID"

External Aliases

find_by_name -> find_by_full_name
find_by_name_or_id -> find_by_unique_id

Public Class methods

Find by ListID of List record. options are the same as those for in find.

[Source]

    # File lib/qbfc/list.rb, line 24
24:       def find_by_id(sess, id, options = {})
25:         q = create_query(sess)
26:         q.query.ListIDList.Add(id)
27:         find(sess, :first, q, options)
28:       end

Find by name (actually, FullName) of List record. options are the same as those for in find.

[Source]

    # File lib/qbfc/list.rb, line 14
14:       def find_by_name(sess, full_name, options = {})
15:         q = create_query(sess)
16:         q.query.FullNameList.Add(full_name)
17:         find(sess, :first, q, options)
18:       end

Find by either name or id. Tries id first, then name.

[Source]

    # File lib/qbfc/list.rb, line 31
31:       def find_by_name_or_id(*args)
32:         find_by_id(*args) || find_by_name(*args)
33:       end

Public Instance methods

Delete this List record.

[Source]

    # File lib/qbfc/list.rb, line 53
53:     def delete
54:       req = QBFC::Request.new(@sess, "ListDel")
55:       req.list_del_type = QBFC_CONST::const_get("Ldt#{qb_name}")
56:       req.list_id = id
57:       req.submit
58:       return true
59:     end

Display the Transaction add (for new records) or edit dialog box

[Source]

    # File lib/qbfc/list.rb, line 62
62:     def display
63:       if new_record?
64:         req = QBFC::Request.new(@sess, "ListDisplayAdd")
65:         req.list_display_add_type = QBFC_CONST::const_get("Ldat#{qb_name}")
66:       else
67:         req = QBFC::Request.new(@sess, "ListDisplayMod")
68:         req.list_display_mod_type = QBFC_CONST::const_get("Ldmt#{qb_name}")
69:         req.list_id = id
70:       end
71:       req.submit
72:       return true
73:     end

If an entity has a Name field but not a FullName field, use Name (which, by implication, is the FullName)

[Source]

    # File lib/qbfc/list.rb, line 46
46:     def full_name
47:       respond_to_ole?("FullName") ?
48:         @ole.full_name :
49:         @ole.name
50:     end

Alias of ListID for this record. This is a unique within each type of List.

[Source]

    # File lib/qbfc/list.rb, line 40
40:     def id
41:       @ole.list_id
42:     end

[Validate]