Method: IntacctRB::Attachment#create

Defined in:
lib/intacctrb/attachment.rb

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/intacctrb/attachment.rb', line 6

def create
  return false if object.intacct_system_id.present?

  send_xml('create') do |xml|
    xml.function(controlid: "f1") {
      xml.create_supdoc {
        attachment_xml xml
      }
    }
  end

  if !successful?
    raise IntacctRB::Exceptions::Attachment.new(response.at('//error//description2'))
  end

  object.intacct_id
end