Sha256: c053cda8e19d715363aa1b4bbc97663e4e52d3427d296cd951b684000e9bc21b

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

module NetSuite
  module Records
    class CustomRecord
      include Support::Fields

      fields :allow_attachments, :allow_inline_editing, :allow_numbering_override, :allow_quick_search, :created,
        :custom_record_id, :description, :disclaimer, :enabl_email_merge, :enable_numbering, :include_name,
        :is_available_offline, :is_inactive, :is_numbering_updateable, :is_ordered, :last_modified, :name,
        :numbering_current_number, :numbering_init, :numbering_min_digits, :numbering_prefix, :numbering_suffix,
        :record_name, :script_id, :show_creation_date, :show_creation_date_on_list, :show_id, :show_last_modified_on_list,
        :show_last_modified, :show_notes, :show_owner, :show_owner_allow_change, :show_owner_on_list, :use_permissions

      def initialize(attributes = {})
        initialize_from_attributes_hash(attributes)
      end

      def self.get(options = {})
        options.merge!(:type_id => type_id) unless options[:type_id]
        response = Actions::Get.call(self, options.merge!(:custom => true))
        if response.success?
          new(response.body)
        else
          raise RecordNotFound, "#{self} with OPTIONS=#{options.inspect} could not be found"
        end
      end

      def self.type_id(id = nil)
        if id
          @type_id = id
        else
          @type_id
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netsuite-0.0.17 lib/netsuite/records/custom_record.rb
netsuite-0.0.16 lib/netsuite/records/custom_record.rb