README.md in netsuite-0.8.10 vs README.md in netsuite-0.8.11
- old
+ new
@@ -1,23 +1,5 @@
-<!-- START doctoc generated TOC please keep comment here to allow auto update -->
-<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
-**Table of Contents**
-
-- [NetSuite SuiteTalk API Ruby Gem](#netsuite-suitetalk-api-ruby-gem)
-- [Help & Support](#help--support)
-- [Testing](#testing)
-- [Installation](#installation)
- - [Configuration](#configuration)
- - [Token based Authentication](#token-based-authentication)
-- [Usage](#usage)
- - [CRUD Operations](#crud-operations)
- - [Custom Records & Fields](#custom-records--fields)
- - [Searching](#searching)
- - [Non-standard Operations](#non-standard-operations)
-
-<!-- END doctoc generated TOC please keep comment here to allow auto update -->
-
[](https://github.com/NetSweet/netsuite/actions/workflows/main.yml)
[](http://opensuite-slackin.herokuapp.com)
[](http://badge.fury.io/rb/netsuite)
# NetSuite SuiteTalk API Ruby Gem
@@ -234,9 +216,22 @@
options = NetSuite::Records::BaseRefList.get_select_value(
field: 'custbody_order_source',
recordType: 'invoice'
)
options.base_refs.map(&:name)
+```
+
+## Uploading/Attaching Files
+
+```ruby
+file = NetSuite::Records::File.new(
+ content: Base64.encode64(File.read('/path/to/file')),
+ name: 'Invoice.pdf',
+)
+file.add
+
+invoice = NetSuite::Records::Invoice.get(internal_id: 1)
+invoice.attach_file(NetSuite::Records::RecordRef.new(internal_id: file.internal_id))
```
## Custom Records & Fields
```ruby