fmAccounting Link (Xero Edition) Update – Notes & History and Attachments

In Xero, you can view the history of changes made to invoices, bills, transactions, inventory items, contacts and more. This audit trail also shows any notes recorded by users in the Xero app but until recently this information was not available via the Accounting API.

Earlier this year Xero added a new endpoint to the Accounting API to allow developers to be able to download the notes/history and also add new notes. We’ve just released an update to fmAccounting Link (Xero Edition) that includes examples for downloading and creating Notes for Contacts and Invoices.

The history and notes for an Invoice in the Xero web app looks like this:

and contains important information, such as when the Invoice was sent to the customer and if they have viewed the invoice online. We’ve added a new Notes tab to display the same information in the fmAccounting Link file:

You can download all the Notes from Xero for an Invoice and a Contact and create a new Note and upload that to Xero for a Invoice and a Contact. We started adding support for the new History and Notes endpoint for Contacts and Invoices as these are two of the most popular modules, but will gradually add them to the other supported modules such as Bills, Credit Notes, Items etc.

We also took this opportunity to extend the support for working with Attachments to also include the ability to download Attachments for an Invoice and create/download Attachments for a Contact.

Here’s a video that demonstrates working with History and Notes and Attachments in fmAccounting Link (Xero Edition):

FileMaker Developer Conference 2018

The FileMaker Developer Conference 2018 starts next week (August 6-9) in Dallas, Texas at the amazing Gaylord Texan Resort. This will be my 14th DevCon and also the first time I’ve been able to fly direct from my hometown of Sydney, Australia to the DevCon city. I’m looking forward to learning about the future directions of the FileMaker platform and catching up with fellow developers from all around the world (I’m definitely not looking forward to spending 15h 25m in economy though).

Databuzz was not able to secure an exhibitors booth this year so please get in touch if you would like to arrange a time to meet to discuss our FileMaker integration products or arrange a demonstration of our Xero, WooCommerce, Shopify, SMS and MYOB solutions.

This year for the very first time you will be able to live stream a special session from DevCon where you will hear members of FileMaker Product Management and Product Development share their insights with you – you can register for the live stream here (it starts at 9:00 am Dallas time which is 12am AEST).

I’ll be sharing some highlights from DevCon alongside other DevCon attendees at the inaugural FileMaker Dev Sydney meeting in September. If you live in Sydney please join the new Meetup group and register for our first meet up.

WordCamp Sydney 2018 Recap

Here at Databuzz we love WordPress and WooCommerce and have been using both in our business for many years. I’ve never attended a WordCamp before – WordCamps are informal, community-organized events that are put together by WordPress users – but that changed last weekend when I attended and presented at my first WordCamp – WordCamp Sydney 2018:

I had a great time at the conference meeting fellow WordPress enthusiasts and learning more about the WordPress platform. The conference had a particular focus on Gutenberg, the new editor coming soon to WordPress as part of the 5.0 release. You can try Gutenberg now by installing the Gutenberg plugin – I was impressed by what Gutenberg can do and it really brings the WordPress editor into the modern age.

The videos and the slides from the conference should be available on WordPress.tv in around 2-3 weeks. I’ve uploaded a copy of my slides here as well if you would like to download a copy.

I’m looking forward to attending more WordCamps in the future – you can see all the upcoming WordCamps at the WordCamp Central site. I would like to thank all the event organisers and the sponsors for putting on a great conference at an excellent venue: UTS has changed a lot since I was a student nearly 30 years ago!

fmEcommerce Link (Shopify Edition) Multi-Location Inventory Update

At this year’s Unite event Shopify announced Locations, which enables merchants to manage inventory, fulfillments, and restocks across multiple locations from the Shopify admin. Currently inventory is set and adjusted on the product variant and is not tracked by any particular location. In anticipation of multi-location inventory, Shopify have released a new Inventory API, which includes two new endpoints: Inventory Item and Inventory Level. The Inventory API will allow apps to effectively manage inventory quantities across multiple locations.

We’ve just released a free update to fmEcommerce Link (Shopify Edition) to include support for working with the new multi-location inventory features and APIs. The main changes in this update are:

  • two new tables: InventoryItems and InventoryLevels
  • the ‘inventory_quantity’ from Product Variant uploads has been disabled as this is now deprecated (use Inventory Level endpoint instead)
  • added examples for working with multi location Inventory: download Inventory Levels and upload Inventory Levels
  • Product Variants: added examples for uploading, downloading and deleting individual Product Variants without having to upload the parent Product

Shopify have announced that the new multi-location inventory features will go live on August 1, which means the API changes will also happen at the same time. The main impact for fmEcommerce Link users is that you will no longer be able to set inventory on the Product/Variant APIs and must use the new Inventory Level API instead. We recommend reading the following articles on the Shopify website to get a better understanding of these changes:

The following chart from Shopify illustrates the relationship between a Product Variant and the new Inventory Item and Inventory Level resources:

 

With the new multi-location inventory changes each variant is now always linked to a single InventoryItem – there is a new 1:1 relationship between a Product Variant and an Inventory Item. Each product variant includes a inventory_item_id. Each InventoryItem must be stored in at least one location at any given time. Inventory stored in each location is represented by the new InventoryLevel resource. We’ve added a new Inventory TAB in the Setup screen where you can view all Locations, InventoryItems and InventoryLevels:

When viewing a Product Variant you can now view all related Inventory Levels:

and within each Inventory Level you can set the Inventory Level for that Location, adjust the Inventory Level up/down and delete the Inventory Level from Shopify:

This is a free update to all our existing customers – you can get the full details of the changes in the release notes for fmEcommerce Link (WooCommerce Edition). Existing customers can download this new version using their existing download links from their original order – please contact us if you have any issues downloading this update.

The following video demonstrates how to use the new multi-location inventory features in v1.1 of fmEcommerce Link (Shopify Edition):

FileMaker and the Twilio API

Here at Databuzz we’re longtime fans of Twilio, the company with the strange name that offers a Cloud communications platform, providing the building blocks to add messaging, voice, and video in your web and mobile applications.

For many years we’ve been working with the Twilio API, primarily to send and receive SMS messages using our fmSMS FileMaker solution. Twilio provides great coverage and very competitive pricing and we’ve been recommending Twilio to our customers for many years – when they ask which SMS Gateway we use at Databuzz we don’t hesitate to recommend Twilio.

Earlier this year we had the chance to attend the first Twilio Engage Sydney and learn more about the company’s strategy and participate in some great product demos. Twilio are opening 2 new offices in Melbourne and Sydney and it was great to be able to meet some of their Australian based staff in person.

We’ve written about how we use the Twilio API in the past, including a demonstration for Voice Calling with FileMaker and Twilio as well as sending Emojis from fmSMS. We’ve also made some custom solutions for customers to allow them to send and receive MMS (picture messages) messages from the FileMaker platform.

Over the past few months we’ve had the opportunity to work on some additional Twilio APIs that enhance the functionality found in our fmSMS solution, including:

  • adding phone number lookup functionality via the Twilio Lookup API
  • adding the ability to poll Twilio for any incoming messages that may not have been delivered due to a local server/Internet outage when using the regular Webhooks

For some customers the ability to check a number before sending an SMS or MMS message is important as it allows you to verify that the number you are about to send a message to is indeed a mobile number. For example you might have a list of Customers and associated phone numbers, but you aren’t sure if the number is a landline number or a mobile number. Using the Twilio Lookup API you can make a request to verify a number and receive information about the carrier and optionally (where supported) the caller name, allowing you to confirm the veracity of the number.

fmSMS includes the necessary PHP files to receive incoming messages to your Twilio number and have these pushed automatically to your FileMaker Server, but there may be times when your server or Internet connection is offline but you would still like to download any missed messages into your FileMaker solution. We’ve helped customers add the ability to “poll” the Twilio Messages API for any incoming messages to their Twilio number that they might have missed during a planned or unscheduled outage.

We’ve put together a simple demonstration video showing these in action – you can watch the video inline below or directly on YouTube:

fmAccounting Link (Xero Edition) and Unit Price Rounding in Xero

By default the Xero API accepts unit prices (UnitAmount) to two decimals places – this means that if you were entering a line item on an Invoice and entered ‘1.795’ for the Unit Price it would be rounded to $1.80 in Xero. For most customers 2 decimal places is sufficient for the line item unit price, however there are some customers that do require greater precision. Xero offer a way to opt-in to 4 decimal places by adding a parameter to your API request.

For example if you wanted to create an Invoice and include 4 decimal places on the unit price for the line items you would change the URL from:

https://api.xero.com/api.xro/2.0/Invoices

to:

https://api.xero.com/api.xro/2.0/Invoices?unitdp=4

Unfortunately it wasn’t as simple as changing the URL in the appropriate fmAccounting Link scripts – even after changing the URL and including unit prices on the line items with 4 decimal places they were still being rounded to two decimals places when uploaded to Xero. We’ve come up with a solution to this to allow you to specify unit prices with 4 decimal places – you’ll need to simply install an updated version of the BaseElements plug-in (v3.3.8) and make sure you change your request URL to include the additional querystring parameter.

If you need to specify unit prices with 4 decimal places please get in touch and we’ll send you the new version of the BaseElements plug-in to use. You can get more information on the Xero developer website here:

https://developer.xero.com/documentation/api-guides/rounding-in-xero

Andrew Duncan from Databuzz to speak at WordCamp Sydney 2018

 

WordCamp Sydney 2018 is on 28 & 29 July this year at the University of Technology Sydney. Databuzz is pleased to announce that Andrew Duncan will be speaking this year on WooCommerce integration using the WooCommerce API.

Databuzz are big fans of WooCommerce and WordPress – we’ve been using WordPress and WooCommerce for many years to run our websites and eCommerce platforms. Our fmEcommerce Link (WooCommerce Edition) solution is one of our most popular products and we can continue to update this with new features and improvements.

We look forward to meeting up and discussing all things WordPress – you can get tickets and more information from the WordCamp Sydney 2018 site here:

https://2018.sydney.wordcamp.org/

fmAccounting Link and Two-factor authentication with Xero and MYOB

 

As more IT services move to the cloud the risk of unauthorised access and security breaches becomes something that most small business owners need to manage in order to protect access to their critical business systems and sensitive data. The past few years has seen a significant increase in the number of online services coming under cyber attack and sustaining security breaches, as well as the rise in identify theft and online fraud. Security industry research shows that over 40% of cyber attacks last year targeted small businesses and this is increasing.

In additional to the traditional username and password login, many online services now offer an extra layer of protection in the form of two-factor authentication, also commonly referred to as 2FA. With two-step authentication enabled you need to provide two authentication “factors” to login alongside your username. The first factor is something you know – typically your account password.  The second factor is something you have – typically a unique code that’s generated by a separate app on your smartphone or sent via SMS to your registered mobile phone.

Some of the largest online services including Google, Microsoft, Apple, Twitter, Facebook and LinkedIn now offer two-factor authentication – users will typically have to first login using their username/password, then immediately have to enter a 2nd level of authentication (typically a one time code that is sent via SMS or generated via an authenticator app like Google Authenticator).

Two-factor authentication is available for both Xero and MYOB, and in Australia the use of 2FA will be mandatory for accountants and bookkeepers by 30 June 2018 to meet new industry standards set out by the Australian Tax Office. We’ve been using two-factor authentication with Xero and MYOB and are pleased to report there are no issues with 2FA and the use of fmAccounting Link (Xero Edition) or fmAccounting Link (MYOB AccountRight Edition).

With our fmAccounting Link (Xero Edition) solution we connect to the Xero API via the use of a Private Application, so users are not required to authenticate each time they connect to the Xero API to upload or download data. With fmAccounting Link (MYOB AccountRight Edition) if you are using the MYOB Cloud to host your AccountRight company file you will simply be presented with the additional login page to enter your 2FA code – here’s a screenshot showing this:

You can learn more about two-factor authentication for Xero and MYOB at the following links:

FileMaker, cURL and HTTP Response Codes

When FileMaker Inc. released the FileMaker 16 Platform last year they included a feature I had been requesting for over 15 years – native cURL support. cURL is a command line tool and library for transferring data with URLs – you’re probably familiar with the HTTP, HTTPS, FTP and SMTP protocols. cURL is important as it allows us to interact with external web services/APIs directly from FileMaker Pro, FileMaker Go, FileMaker WebDirect and FileMaker Server. For example we can use FileMaker to send an SMS, upload an Invoice to Xero or MYOB, or download Orders from eCommerce platforms like WooCommerce or Shopify.

Starting with the introduction of the Insert From URL script step in FileMaker Pro v12 we’ve been able to interact with URLs with some limitations:

  • FileMaker Pro v12 introduced the Insert From URL script step which supported http, https, ftp, ftps, and file protocols. A field was required to download the result/response into and it didn’t support performing an HTTP/S POST request – only GET requests were supported (most APIs require a POST request to create/update records via the API). There was also no ability to customise the HTTP request, e.g. to set HTTP Headers which are often required for many APIs
  • FileMaker Pro v13 extended the Insert From URL script step to both HTTP GET and HTTP POST requests using the httppost and httpspost custom schemes that you specified when constructing the URL (e.g. “httppost://www.filemaker.com/path?fname=Bob&lname=Smith”). You still couldn’t specify HTTP Headers and still required a field for the result

Given these limitations I rarely used the Insert from URL script step until FileMaker Pro 16 was released. Since the FileMaker Pro v6 days I have been using a number of different plug-ins to perform HTTP requests – initially I had a custom plug-in developed, then switched to the Troi URL plug-in and then to the BaseElements plug-in. Databuzz sponsored the development of some specific functions that we needed and the BaseElements plug-in provided us with cURL support and a number of other related functions, such as JSON encoding and parsing and XPath for parsing XML data. The BaseElements plug-in has provided us with the functionality we needed that was missing in the FileMaker platform, but as a plug-in was required it did have a number of disadvantages:

  • FileMaker Go does not support plug-ins (you can now use the iOS SDK). You could use FileMaker Server script schedules and Perform Script on Server as a workaround but this required the FileMaker solution to be hosted by FileMaker Server so wouldn’t work for solutions running locally on the iPad or iPhone
  • running scripts under FileMaker Server required the plug-in to be installed on the server, which can be done easily as long as the appropriate permissions have been granted in the FileMaker Server Admin Console. Some hosting providers also disabled the option to install plug-ins on shared servers.

With the release of the FileMaker 16 platform came the ability to specify one or more supported cURL options as a calculation when using the Insert From URL script step, as well as the ability to specify a variable as the target (no more fields required!). This was a game changer as far as working with APIs was concerned – now the entire FileMaker Platform could natively make HTTP requests, set HTTP Headers, and encode JSON data and parse JSON. All of our integration solutions were using the BaseElements plug-in, so we started to work on adding native support for FileMaker Pro v16 users by switching from the BaseElements plug-in functions to using the native Insert From URL script step, cURL options and JSON functions.

One function for which there was no native equivalent was the BE_HTTP_Response_Code function which returns the HTTP response code value from the last request. HTTP Response Codes are issued by the server in response to a request and can be used to determine whether the HTTP request was successfully completed or if there were issues associated with the request. For example 200 is the standard response for a successful request and 401 means there was an authentication issue and the request failed. It’s important when working with APIs to check the HTTP Response Code to confirm that the request was processed successfully – the documentation for each API will usually specify what response code indicates a successful request (typically 200 or 201).

The HTTP Response Code is contained with the HTTP Response Headers which are returned by the server processing the request. You need to specify the following cURL option to get the response headers returned into a FileMaker variable:

" --dump-header $responseHeaders"

The $responseHeaders variable will then contain something like this after the Insert From URL script step has been performed:

HTTP/1.1 200 OK
Date: Wed, 13 Jun 2018 04:45:17 GMT
Server: Apache/2.4.26 (Red Hat)
X-Powered-By: PHP/5.6.35
Transfer-Encoding: chunked
Content-Type: application/json; charset=UTF-8

In the above example you can see the first line of the response headers contains the response code: “HTTP/1.1 200 OK”. Other common response codes that you might encounter include:

HTTP/1.1 100 Continue
HTTP/1.1 403 Forbidden
HTTP/1.1 201 Created
HTTP/1.1 302 Found
HTTP/1.1 301 Moved Permanently

You can use standard FileMaker functions to get the actual numerical response code from the first line of the response headers, e.g.:

Let ( [
t1 = GetValue ( $responseHeaders ; 1 ) ;
t2 = Substitute ( t1 ; " " ; "¶" ) ;
n1 = GetValue ( t2 ; 2 )
] ;

n1

) // Let

This all works fine as long as the Response Headers only contain a single response code, but sometimes the server will return multiple response codes. For example the response might include a redirect or a continue and look like this:

HTTP/1.1 100 Continue

HTTP/1.1 403 Forbidden
Server: nginx/1.14.0
Date: Wed, 13 Jun 2018 07:41:16 GMT
Connection: keep-alive

The response code we are after is the “403” value and not the “100” value, so our above calculation would return the wrong response code in this situation. We started working on a custom function that would look for the last “HTTP/1.1” string and then get the code following this, but that failed pretty quickly when working with a server that included the string “HTTP/1.1” elsewhere in the response headers.

We’ve settled on using this custom function which so far is returning the correct result, at least with the APIs and servers that we have tested it on so far. We would much rather have a native function for this which does the equivalent of what the BaseElements BE_HTTP_Response_Code function does without having to try to locate and find the last response code from the response headers. From researching this it appears that there is already a cURL option for this:

-w "%{http_code}"

but unfortunately the -w option is not one of the FileMaker supported cURL options, so for now you’ll need to parse out the response code until FileMaker add support for the -w option. We’ve added this to the FileMaker Product Ideas discussion area – if you would also like to see this feature in a future version of FileMaker platform you can vote up the idea here.

FileMaker Inc. releases FileMaker 17 Platform

FileMaker Inc. today released the FileMaker 17 Platform with new versions of FileMaker Pro Advanced, Server, FileMaker Go and FileMaker WebDirect. As with previous releases FileMaker 17 has a number of new features for both customers and developers alike. This releases marks the fourth annual release that started with v14 with all new versions shipping in May each year.

Updates in the FileMaker 17 Platform include:

Development:

  • Starter apps: Get started more quickly by choosing one of six new starter apps. Add more functionality to an app by connecting an add-on table.
  • Master-detail layouts: Leverage the new portal enhancements to create common design patterns like master-detail layouts.
  • Redesigned layout mode: Create custom apps more easily with layout tools that are more discoverable through convenient panes inside the document window.

Mobility:

  • Sensor support: Using a new calculation function, mobile apps can capture information from iOS sensors in iPad or iPhone devices.
  • Configure local notification: Display a local notification on an iPad or iPhone device when FileMaker Go is not running or is in the background.
  • Drag and drop:  Go faster with drag and drop of text, photos, and files between apps on iPad devices running iOS 11.2.

Administration and Integration:

  • FileMaker Server Admin Console: Redesigned to be more lightweight with a streamlined user interface.
  • FileMaker Admin API trial: Get REST API access to manage and administer FileMaker Server. Trial expires Sept. 27, 2019.
  • FileMaker Data API: This improved REST API includes support for FileMaker Server scripts, the ability to upload files to container fields, and a more standardized API format.

The release of the FileMaker 17 Platform also sees the end of FileMaker Pro as a standalone application, as it is now replaced by FileMaker Pro Advanced. FileMaker Pro and FileMaker Pro Advanced are no longer sold as separate products – you now enable the Advanced developer features such as the Script Debugger and Data Viewer when the Use advanced tools general preference is selected.

FileMaker Inc. also released a new FileMaker data migration tool that can significantly reduce the time it takes to migrate/import data from one version of a FileMaker solution to another (e.g. when moving data from a production version to the latest development version). The data migration process can now go from days to hours or hours to minutes when importing large data sets. This new time-saving command-line tool helps you update your deployed custom apps in no time. The data migration tool is available through the FileMaker Developer Subscription.

With the  launch of the FileMaker 17 Platform FileMaker Inc. have also announced new licensing programs that replace the previous programs – the primary new offering is called FileMaker User Licensing. FileMaker User Licensing is a simple, cost-effective way for teams to license the entire FileMaker Platform. FileMaker User Licensing is based on the number of unique users a company or organization has that need to use FileMaker software. The key components of the new FileMaker User Licensing Program are:

  1. Every license includes the entire FileMaker 17 Platform – FileMaker Server, FileMaker Go, FileMaker WebDirect, and FileMaker Pro Advanced – which replaces FileMaker Pro – to give everyone access to advanced development and customization features.
  2. Start at 5, add in increments of 1 – the initial minimum quantity is 5 users, and you can add users in increments of 1.
  3. New FileMaker Data API – each license comes with unlimited inbound data transfer and 2 GBs of outbound data transfer, per user, per month – shared and tracked annually.
  4. All new contracts are managed under one license key – and the license key will not change over time making renewals and additions much easier to manage.

We’re please to report that all Databuzz products are compatible with the FileMaker 17 Platform:

We’ll be publishing more articles over the coming months looking at some of the new features in the FileMaker 17 Platform in more depth – you can subscribe to our newsletter to be notified when they are released or follow us on Twitter or Facebook.