Class: NetSuite::Records::SalesOrderItem
- Inherits:
-
Object
- Object
- NetSuite::Records::SalesOrderItem
- Defined in:
- lib/netsuite/records/sales_order_item.rb
Overview
Beaware of possible gotcha when closing sales order. You need to set the SalesOrder#custom_form to “Basic Sales Order Form” otherwise you might get errors when trying to close it
Instance Method Summary collapse
-
#initialize(attributes_or_record = {}) ⇒ SalesOrderItem
constructor
A new instance of SalesOrderItem.
- #initialize_from_record(record) ⇒ Object
- #to_record ⇒ Object
Methods included from Namespaces::TranSales
Methods included from Support::Records
Methods included from Namespaces::PlatformCore
Methods included from Support::Attributes
#attributes, #attributes=, #initialize_from_attributes_hash
Methods included from Support::RecordRefs
Methods included from Support::Fields
Constructor Details
#initialize(attributes_or_record = {}) ⇒ SalesOrderItem
Returns a new instance of SalesOrderItem.
22 23 24 25 26 27 28 29 |
# File 'lib/netsuite/records/sales_order_item.rb', line 22 def initialize(attributes_or_record = {}) case attributes_or_record when Hash initialize_from_attributes_hash(attributes_or_record) when self.class initialize_from_record(attributes_or_record) end end |
Instance Method Details
#initialize_from_record(record) ⇒ Object
31 32 33 |
# File 'lib/netsuite/records/sales_order_item.rb', line 31 def initialize_from_record(record) self.attributes = record.send(:attributes) end |
#to_record ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/netsuite/records/sales_order_item.rb', line 35 def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end |