Sha256: 1fa12a7f180cdfdda4f9cb2c39d00f464794846515087ebd449c13804c0fe61c

Contents?: true

Size: 995 Bytes

Versions: 10

Compression:

Stored size: 995 Bytes

Contents

module NetSuiteRails
  module SubListSync

    def self.included(klass)
      klass.send(:extend, ClassMethods)

      NetSuiteRails::SyncTrigger.attach(klass)
    end

    # one issue here is that sublist items dont' have an internal ID until
    # they are created, but they are created in the context of a parent record

    # some sublists don't have an internal ID at all, from the docs:
    # "...non-keyed sublists contain no referencing keys (or handles)"
    # "...Instead, you must interact with the sublist as a whole.
    # In non-keyed sublists, the replaceAll attribute is ignored and behaves as if
    # it were set to TRUE for all requests. Consequently, an update operation is
    # similar to the add operation with respect to non-keyed sublists."

    module ClassMethods
      def netsuite_sublist_parent(parent = nil)
        if parent.nil?
          @netsuite_sublist_parent
        else
          @netsuite_sublist_parent = parent
        end
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
netsuite_rails-0.3.6 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.3.5 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.3.4 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.3.3 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.3.2 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.3.1 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.2.2 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.2.1 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.2.0 lib/netsuite_rails/sub_list_sync.rb
netsuite_rails-0.1.0 lib/netsuite_rails/sub_list_sync.rb