Sha256: f65563001ebdb7efb56dce14fc63102d61853621f2e2fee323d740456e7bbfd4

Contents?: true

Size: 1.55 KB

Versions: 42

Compression:

Stored size: 1.55 KB

Contents

module NetSuite
  module Records
    class Contact
      include Support::Fields
      include Support::RecordRefs
      include Support::Records
      include Support::Actions
      include Namespaces::ListRel

      actions :get, :get_list, :add, :delete, :delete_list, :search, :update, :upsert

      fields :salutation, :first_name, :middle_name, :last_name, :title, :phone, :fax, :email, :default_address,
             :entity_id, :phonetic_name, :alt_email, :office_phone, :home_phone, :mobile_phone, :supervisor_phone,
             :assistant_phone, :comments, :bill_pay, :is_private, :is_inactive

      field :addressbook_list,  CustomerAddressbookList
      field :custom_field_list, CustomFieldList
      # field :subscriptions_list, SubscriptionsList
      # field :category_list, CategoryList

      read_only_fields :last_modified_date, :date_created

      record_refs :custom_form, :company, :subsidiary, :supervisor, :assistant, :image, :global_subscription_status

      attr_reader   :internal_id
      attr_accessor :external_id

      def initialize(attributes = {})
        @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
        @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
        initialize_from_attributes_hash(attributes)
      end

      def to_record
        rec = super
        if rec["#{record_namespace}:customFieldList"]
          rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
        end
        rec
      end

    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
netsuite-0.8.1 lib/netsuite/records/contact.rb
netsuite-0.8.0 lib/netsuite/records/contact.rb
netsuite-0.7.9 lib/netsuite/records/contact.rb
netsuite-0.7.8 lib/netsuite/records/contact.rb
netsuite-0.7.7 lib/netsuite/records/contact.rb
netsuite-0.7.6 lib/netsuite/records/contact.rb
netsuite-0.7.5 lib/netsuite/records/contact.rb
netsuite-0.7.4 lib/netsuite/records/contact.rb
netsuite-0.7.3 lib/netsuite/records/contact.rb
netsuite-0.7.2 lib/netsuite/records/contact.rb
netsuite-0.7.1 lib/netsuite/records/contact.rb
netsuite-0.7.0 lib/netsuite/records/contact.rb
netsuite-0.6.9 lib/netsuite/records/contact.rb
netsuite-0.6.8 lib/netsuite/records/contact.rb
netsuite-0.6.7 lib/netsuite/records/contact.rb
netsuite-0.6.6 lib/netsuite/records/contact.rb
netsuite-0.6.5 lib/netsuite/records/contact.rb
netsuite-0.6.4 lib/netsuite/records/contact.rb
netsuite-0.6.3 lib/netsuite/records/contact.rb
netsuite-0.6.2 lib/netsuite/records/contact.rb