Skip to content

Fixing Bundler Issues After a macOS Sierra Upgrade

I recently upgraded my laptop, and with that came setting up a fresh dev machine. With a fresh install always comes with a set of development configuration problems. Here’s some tips of resolving ruby bundler issues in MacOS Sierra. These tips assume you are using dotfiles that look similar to these. Also, I prefer fresh installs, so I never pull config from my old machine/OS. These fixes may not work if you are migrating configuration from a previous OS. For any of the fixes outlined below: Adjust the version strings based on your project If you do not have bundler’s shared gems disabled, then you can omit the –install-dir directives. An error occurred while installing pg (0.18.4), and Bundler cannot continue…

Continue Reading

Notes on NetSuite’s Gift Certificate Record

The gift certificate functionality in NetSuite is much more limited than other functionality in NetSuite. It’s also the only option for implementing store credit, electronic, and physical gift cards in NetSuite. If you need to integrate with the gift certificate system in NetSuite, here are some notes to help you along the way: Gift certificates are not created directly. They are are created by creating a “Gift Certificate Item” and using that item in a SalesOrder. Gift certificates can be created without an associated posting transaction (Sales Order) by importing a CSV. However, you cannot create a standalone gift certificate via SuiteTalk…

Continue Reading

Finding the NetSuite Deposit Associated with a Payment or Refund

Determining which NetSuite deposit record is associated with a customer payment, customer refund, cash payment, cash refund, etc using SuiteTalk is not straightforward. It’s also challenging to determine if a refund record is still available to be deposited. Payment transactions have a status field which indicates if a record has been deposited or not, but refund records do not have this field. In order to determine if a refund is deposited, you need to search for an associated deposit…

Continue Reading

How to get a NetSuite demo account for SuiteTalk or SuiteScript development

If you’re looking to integrate with NetSuite, you need a NetSuite instance to use for development. However, getting one isn’t straightforward. Here’s how to get up and running with a NetSuite demo account. Signup for a "SDN Community Edition" account. Here’s a direct link to the signup form. After submitting the form, you’ll be told that you will get a response. You won’t. I’ve applied for multiple SDN accounts on behalf of clients and they’ve never gotten a response. You’ll need to email sdnsupport@netsuite.com with the following template: SDN Support, I applied for a NetSuite test account a couple days ago, and I have not received an update…

Continue Reading

Using NetSuite’s Token Based Authentication with SuiteTalk

NetSuite’s OAuth is very different from the standard oauth flow: setting up a user for token based auth is very cumbersome. It requires digging around in the NetSuite GUI, creating roles, and copy/pasting various keys. Why use token based authentication? The alternative is email + password based authentication. This method works fine, but passwords expire every six months; resetting passwords every six months is a huge pain for a SAAS product that integrates with NetSuite. Plus, email + password auth is much less secure (an attacker can login to the GUI with a email and password). Here’s a guide to getting setup with token based authentication. Note that you must be using a SuiteTalk API versions greater than 2015_2. 1…

Continue Reading

Fixing Invalid DATABASE_URL Reference on CircleCI

I’ve become a huge fan of CircleCI—it’s the best CI tool for small-medium projects that I’ve found. Recently I ran into an issue setting up a new rails project with Postgres as the database backend with circle: However, when I looked at my database.yml the constant DATABASE_URL was clearly not being used. DATABASE_URL was properly being used as the lookup string for an ENV reference: I was stumped for a while until I ssh’d into circle and noticed that somehow the single quotes were stripped from DATABASE_URL: Circle’s build inference process involves generating a database.yml file which uses the original database.yml file to some extent…

Continue Reading

Sending Dokku Container Logs to Papertrail

I’m a huge fan of Heroku. Although it’s expensive compared to a raw DigitalOcean droplet or EC2 instance, it’s so easy and it just works. However, there are some use-cases that Heroku doesn’t handle well. Business integration systems (eCommerce NetSuite integration, for example) often require handling requests that may take longer than the 30 second request timeout. Dokku is the next-best alternative to using heroku (if you don’t have enormous scaling needs: dokku apps are restricted to a single host). Here’s how to push your dokku app logs running to PaperTrail, or another syslog-compatible cloud hosting provider (I’m sure this approach would work for Loggly or CloudWatch)…

Continue Reading

Split Shipment Fulfillment with NetSuite

NetSuite natively supports partially fulfilling a SalesOrder. However, updating an ItemFulfillment record (NetSuite’s equivalent to a ‘package’ or ‘shipment’ in other systems nomenclature) after it’s been created comes with some unique edge cases in NetSuite. Here’s the NetSuite state that I was operating in: Sales Order is created. order_status = _partiallyFulfilled An ItemFulfillment exists with ship_status = _picked A CustomerDeposit representing the payment coming from an external system is associated with the SalesOrder The contents of the created ItemFulfillment need to be adjusted and a second ItemFulfillment needs to be created…

Continue Reading

Convert MS SQL Database to CSV or MySQL

This is more of a thorny issue that you would at first expect – Microsoft does not provide an easy way out of their database if you are on a different platform. The open source (or paid!) tools available for interacting with Microsoft SQL databases on OS X are very limited. There are not any native GUIs available (to my knowledge), I’ve found that getting TDS up and running is a pain, and it seems impossible to import a .bak or ms sql insert dump. Additionally, I’ve had weird encoding + CSV formatting issues when given a CSV exported from a dump given to me. I’ve discovered a workaround to the issue that has worked reliable for very large data sets (30,000+ rows). Oracle’s SQL Developer application can connect to a ms sql database…

Continue Reading

PHP, MS SQL, and Linux

Note: this was a draft from 2009. I never finished documenting everything, and I (thankfully!) no longer have to integrate with the MS SQL database mentioned here. However, I figured I throw this information out there in case someone was running into the same configuration issues I was. — Usually I am lucky enough that most of my clients don’t have many of their internal operations tied into their web site’s databases; if they are using MS SQL or some other database engine that isn’t open source I’m able to easily convince them to transfer their data over to MySQL. Recently I was working with a client where this wasn’t the case, there was no way around it: I would have to integrate with a MS SQL database…

Continue Reading