ShipHawk Guide

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The ShipHawk SuiteApp has the ability to sync orders instantly to ShipHawk when certain user events occur. Many customers do not have any user events triggered to sync orders to ShipHawk. This document explains how to customize our Map/Reduce saved search to allow customers to control which orders get synced to ShipHawk.

Recent Un-Synced Orders

When the ShipHawk bundle/SuiteApp is installed, a map/reduce script is also installed. The function of this script is to run on a schedule to sync orders to ShipHawk. This script only syncs orders that  have met the correct status, but have also not executed the event scripts. This document covers each piece of this script, and explains the end-to-end process.

Saved Search

  1. ShipHawk determines which orders meet the criteria to be synced by running a saved search. The saved search is installed with the bundle installation. The name of the saved search is Recent Un-synced Orders and the ID is customsearch_shiphawk_recent_unsynced_so.

  2. The criteria for this saved search is as follows:

    1. Type: Sales Order.

    2. ShipHawk Sales Order Sync: ShipHawk Order NBR is EMPTY (signifies it has not synced to ShipHawk).

    3. Date Created is After yesterday.

    4. Date Created is before 5 minutes ago.

    5. Status: Sales Order Pending Fulfillment.

  3. The saved search is executed and runs every 15-minutes. The Map/Reduce Script is what triggers/fires the saved search.

Map/Reduce Script

  1. The Map/Reduce script is a scheduled script. It runs every day in 15-minute intervals.

  2. The name of the script is Link Unsynced Sales Order Map/Reduce. The ID of the script is customdeploy_shiphawk_sync_unsyncedso_mr.

  3. How the script works:

    1. The script runs every 15-minutes.

    2. The script triggers the Recent Un-synced orders saved search and parses the results.

    3. Any order that is at least 5-minutes old is synced to ShipHawk. 

    4. If an order is found to meet all criteria for the script, the ShipHawk Sales Order Event Script is executed to sync the order to ShipHawk.

Customizations

Occasionally, customers may have different criteria to sync orders to ShipHawk. These could include any number of things, but we will use the following example:

  1. One ShipHawk customer only syncs orders to ShipHawk which have the Ready to Ship flag selected. 

  2. This customer performs edits to their sales order to set this flag, which does not trigger event scripts.

  3. We can adjust the Recent Un-Synced Orders saved search criteria to match their use case by adding the Ready to Ship == True to the current list of criteria.

  4. This will now only pull orders in our saved search which meet their criteria.

You can edit the saved search to accomplish a number of tasks. It is highly suggested to preview the search before saving to ensure the proper data is returned in the results.

  • No labels