Custom Hooks

What are Custom Hooks?

Custom Hooks allow you to call custom code in various places throughout the application without modifying the original source code of the Stone Edge Order Manager.  These hooks are commonly used to call custom functions inside a module but can also load alternatives over the built-in forms.  Custom hooks reference code residing in a custom module database outside of the application’s native source code.  When called, the hooks automatically import and merge the custom code on-demand from the custom module database into the native source code.

Custom Hook Quote

Contact Stone Edge if you are interested in using a custom hook or would like us to develop a custom module for you.

Form: Implementation & Customizations – Stone Edge Technologies

Phone: 484-927-4804

Example Uses of Custom Hooks

Example 1:

Let’s say you’re running a promotion and you wanted to give away a free t-shirt for any order over $100.  You can write a module that will look through a group of orders and evaluate each one to see if they are over $100 and if so, the module would add the line item for the free T-Shirt.  Once the code is written, you need to distribute it to every PC and then run it to have it do what it was intended to do.  In this case, it would be recommended to use the “CustomAfterImportCall” or “CustomAfterProcessOrderCall” parameters.  In either case, after an order import is completed or after the imported orders have been processed, the Order Manager would call the name of the function provided by setting either one of those system parameters.

Example 2:

A merchant is dealing with a high amount of packing errors and fraud from customers claiming that their orders were shipped incomplete.  To help alleviate these claims, the merchant wants to photograph each box’s contents just before the carton is sealed and shipped.  The merchant sources a GoPro camera to be mounted to the ceiling above the shipping scales at each packing station. Using the CustomAfterReadScale hook, the merchant develops a function that uses the GoPro API to take a picture of the box’s contents and save that picture with the order in SEOM, the moment after the weight is captured from the shipping scale.

List of Commonly Used Hooks:

  • After Automatic Order Approval
  • After Manual Order Approval
  • After Saving a Manual Order
  • After Import Orders
  • After Processing Imported Orders
  • Before Status Updates
  • Custom Order Import Function
  • Custom Shipping Rate Lookup Call
  • After Import Tracking Numbers
  • After Packing a SKU
  • After Reading a Scale when Packing an Order
  • Carrier Pack and Ship Call

 

  • Adjust Inventory

 

Hooks for Custom Forms and Buttons

  • Custom Main Menu
  • Custom Audit Function
  • Custom Batch Printing Form
  • Custom View Orders Form Button (x2)
  • Custom Manual Orders Form Button (x3)

Setting Up a Custom Hook

Identify which custom hook to use

Custom Hooks are nothing more than system parameters.  Most custom hooks reside in the “Custom” parameter group and begin with the word “Custom” (e.g., “CustomAfterProcessOrderCall” or “CustomFillBackordersCall”).  The name of each custom hook will provide a good hint as to how that hook will behave, but the Parameter Details box will provide more information about its use.

Write your custom code and save it

If you haven’t already done so, you need to write the code that you will use with the custom hook.  When done, you should export your code module to a Microsoft Access database in the exact location as your data file.

Configure SEOM to use a custom function with a hook

Set the following System Parameters:

  • CustomModuleName – This is the name of the code module that contains your custom hook. It’s recommended that you use a portion of your company name in the name of your custom modules and functions to make them easily identifiable and to help ensure uniqueness.  e.g., ‘SEMailFunctions” and “SESendMail”.
  • CustomModuleDatabase – This is the name of the Microsoft Access Database that contains the custom modules and should reside in the same location as your SEOM datafile.
    TIP:  This can be the same database as your Custom Reports database.
  • Set the Parameter Text value of the hook you wish to use equal to the name of your custom function.

Configure SEOM to use a custom form with a hook

Set the following System Parameters:

  • CustomFormDatabase – This is the name of the Microsoft Access Database that contains the custom modules and should reside in the same location as your SEOM datafile.
    TIP:  This can be the same database as your Custom Reports database.
  • Set the Parameter Text value of the hook you wish to use equal to the name of your custom form.

Tips and Tricks

  • If you want to load a custom form at some point in the software, but your desired hook is expecting a function to call, use the DoCmd.OpenForm procedure to launch your custom form.
  • It’s recommended to develop your customizations inside a local copy of SEOM. Before exporting your custom code, make sure the code will compile successfully before exporting it to other PCs.
  • Some hooks are meant to be used instead of built-in forms or modules (i.e., “CustomProcessOrderCall”). In contrast, others are intended to be used in addition to built-in forms and modules (i.e., “CustomAfterProcessOrderCall”).  Read the parameter details carefully to determine how each hook should be used.

 

Custom Parameter Group (Full List)

Parameter Name Comments
CustomAdjustInventoryCall Optional. Name of a function in a custom module that the program should call when any AdjustQOH button is clicked.
CustomAfterAutoApproveCall Optional. Name of a function in a custom module that the program should call after an order is automatically approved with the AutoApprove function.  This does not occur when processing orders on import. Requires CustomModuleDatabase and CustomModuleName.
CustomAfterEditProductCall Optional. Name of a function in custom module the program should call after editing an inventory item.
CustomAfterImportApprovalCall Optional. Name of a function in a custom module that the program should call after an imported order is approved during order processing.
CustomAfterImportCall Optional. Name of a function in a custom module that the program should call as the last step after importing orders from a shopping cart.
CustomAfterImportTrackNumCall Optional. Name of a function in a custom module that the program should call after each tracking number is processed by the Import CSV Tracking Numbers form.
CustomAfterPackSKUCall Name of a custom function to call prior to marking a SKU as “packed” in Pack Orders. No Arguments passed in the function call. The following global variables will be available:

Formvar = Which SKU has been packed

Formvar3 = OM Order # being packed

CustomAfterProcessOrderCall Optional. Name of a function in a custom module that the program should call as the last step when processing imported orders.
CustomAfterReadScaleCall Optional. Name of a function in a custom module that the program should call after reading an electronic scale at Pack & Ship.
CustomAllowedToCall Optional. Name of a function in a custom module that the program should call before performing misc. functions, e.g. Return, Exchange, Add/Edit line item, edit CC info, etc. at View Orders form. Requires CustomModuleDatabase and CustomModuleName.
CustomAuditFunction Custom function to call after the audit report is printed when the Print button is clicked on the Daily Audit form.
CustomBatchPrintForm Name of form to use in place of the Batch Print form
CustomBeforeStatusUpdateCall Name of a custom function to call prior to updating the status of orders or line items. No Arguments passed in the function call. The following global variables will be available:

Formvar = Which Event has been called (See Status Events table)(required)

Formvar2 = Order Number affected (required)

FormVar3 = Line Item Number (optional if 0)

FormVar4 = T/F to update all line items (usually if updating an order event) (Optional)

Formvar5 = Order Status as pulled from Status Events table or passed to function (optional if null)

Formvar6 = Line Item Status as pulled from Status Events table or passed to function (optional if null)

FormVar7 = Notes for the order status change (optional)

FormVar8 = notes for the Line Item status Change (optional)

FormVar9 = T/F to send to SETI Website (optional)

CustomCarrierPackAndShipCall Let’s you use custom carriers at Pack & Ship. If the shipping method has a LabelTemplate, you can also print shipping labels for it.
CustomChangeSKUCall Optional. Name of a function in a custom module that the program should call right before processing each line item from newly imported orders. XML imports only.
CustomCreditCardButtonCall Name of a custom function to call when the custom function button at Credit Card form is clicked. Requires CustomCreditCardButtonLabel, CustomModuleDatabase and CustomModuleName.
CustomCreditCardButtonLabel Label for custom function button at Credit Card info form. See CustomCreditCardButtonCall.
CustomDropShipCall Optional. Name of a function in a custom module that the program should call when any of the “order drop-ship” buttons at View Orders is clicked.
CustomFillBackOrdersCall Optional. Name of a function in a custom module that the program should call when the Fill Backorders button is clicked.
CustomFillOrderCall Optional. Name of a function in a custom module that the program should call when processing orders to check & update inventory, etc..
CustomFilter1Name Name to display for the custom filter to be added to Quick Filter list at View Orders and Orders Filter. Requires CustomFilter1SQL.
CustomFilter1SQLA The first part of SQL String to use for the custom filter to be added to Quick Filter list at View Orders and Orders Filter. Requires CustomFilter1Name. May be continued in CustomFilter1SQLB if longer than 255 characters.
CustomFilter1SQLB The second part, if needed, of SQL String to use for the custom filter to be added to Quick Filter list at View Orders and Orders Filter. Continued from CustomFilter1SQLA if longer than 255 characters.
CustomFilter2Name See notes for CustomFilter1Name.
CustomFilter2SQLA See notes for CustomFilter1SQLA.
CustomFilter2SQLB See notes for CustomFilter1SQLB.
CustomFilter3Name See notes for CustomFilter1Name.
CustomFilter3SQLA See notes for CustomFilter1SQLA.
CustomFilter3SQLB See notes for CustomFilter1SQLB.
CustomFilter4Name See notes for CustomFilter1Name.
CustomFilter4SQLA See notes for CustomFilter1SQLA.
CustomFilter4SQLB See notes for CustomFilter1SQLB.
CustomFilter5Name See notes for CustomFilter1Name.
CustomFilter5SQLA See notes for CustomFilter1SQLA.
CustomFilter5SQLB See notes for CustomFilter1SQLB.
CustomFormDatabase Name of Access database where custom forms are located. Optional. Must be located in the same directory as the store’s Order Manager database.
CustomFulfillmentCall Function to call for sending fulfillment orders.
CustomImportFunction Name of a custom function to call for importing orders. Leave blank to use the standard import function.
CustomMainMenu Name of custom form to use in place of standard Main Menu.
CustomMainMenuCall The custom function call to conditionally load a form at startup. The function should return the form name, otherwise, the system will look at the CustomMainMenu parameter to load a specific form other than Main Menu. If both parameters are not set the Main Menu will load.
CustomManualAfterAddItemCall Name of Custom Function to run after a line item is added to a Manual Order. Variables Passed: Formvar = item number added
CustomManualAfterApprovalCall Optional. Name of a function in a custom module that the program should call after manually approving an order. Requires CustomModuleDatabase and CustomModuleName.
CustomManualAfterSaveCall Optional. Name of a function in a custom module that the program should call after saving a manually-entered order. Requires CustomModuleDatabase and CustomModuleName.
CustomManualAfterUnApprovalCall Optional. Name of a function in a custom module that the program should call after manually un-approving an order. Requires CustomModuleDatabase and CustomModuleName.
CustomManualApprovalCall Optional. Name of a function in a custom module that the program should call before manually approving an order. Requires CustomModuleDatabase and CustomModuleName.
CustomManualApprovalForm Name of form that appears after saving an order at the Manual Orders form. Leave blank if you do not want a form to open at that time.
CustomManualButton1Call Name of a custom function to call when custom function button #1 at Manual Orders form is clicked. Requires CustomManualButton1Label, CustomModuleDatabase and CustomModuleName.
CustomManualButton1Label Label for custom function button #1 at Manual Orders form. See CustomManualButton1Call.
CustomManualButton2Call Name of a custom function to call when custom function button #2 at Manual Orders form is clicked. Requires CustomManualButton2Label, CustomModuleDatabase and CustomModuleName.
CustomManualButton2Label Label for custom function button #2 at Manual Orders form. See CustomManualButton2Call.
CustomManualButton3Call Name of a custom function to call when custom function button #3 at Manual Orders form is clicked. Requires CustomManualButton3Label, CustomModuleDatabase and CustomModuleName.
CustomManualButton3Label Label for custom function button #3 at Manual Orders form. See CustomManualButton3Call.
CustomManualOrdersForm Name of form to use for entering Manual Orders
CustomManualSaveCall Optional. Name of a function in a custom module that the program should call before saving a manually-entered order. Requires CustomModuleDatabase and CustomModuleName.
CustomManualSetupCall Callused when Manual Orders form is opened, and each time the form is cleared for a new order.
CustomModuleDatabase Name of database where custom modules are located. Used with CustomManualButton1Call, CustomModuleName, etc. Optional. Must be located in the same directory as the store’s Order Manager database.
CustomModuleName Name of module in an external database (specified in CustomModuleDatabase) that should be loaded into current .mdb.
CustomOrderButton1Call Name of a custom function to call when custom function button #1 at main Orders form is clicked. Requires CustomOrderButton1Label, CustomModuleDatabase and CustomModuleName.
CustomOrderButton1Label Label for custom function button #1 at main Orders form. See CustomOrderButton1Call.
CustomOrderButton2Call Name of custom function to call when custom function button #2 at main Orders form is clicked. Requires CustomOrderButton2Label, CustomModuleDatabase and CustomModuleName.
CustomOrderButton2Label Label for custom function button #2 at main Orders form. See CustomOrderButton2Call.
CustomPOSAfterAddItemCall Name of Custom Function to run after a line item is added to a POS Order (New POS Only). Variables passed:

Formvar = Item Number Added

FormVar2 = Order Number

FormVar3 = Store ID Number

CustomProcessOrderCall Optional. Name of a function in a custom module that the program should call when processing imported orders.
CustomQuickFilterCall Name of a function to use in place of the Stone Edge Quick Filter function
CustomQuickFilterListCall Name of a function to use in place of the Stone Edge Quick Filter List function
CustomRefillCall Optional. Name of a function in a custom module that the program should call to check inventory for orders added with the ReOrder button at View Orders.
CustomReturnFunction Custom function to call when items are returned to inventory due to Return, Exchange, Cancel/Delete line item or order, Revise, Force Backorder, etc.
CustomShippingFunction Name of a custom function to call for calculating shipping charges. Leave blank to use standard shipping calculations.
CustomStartupCall Optional. Name of a function in a custom module that the program should call on initial entry into Order Manager, or whenever the store is opened.
CustomStatusUpdateCall Optional. Name of a function in a custom module that the program should call when order status is changed by Status Update rules or manually.
CustomYahooProductImportCall Name of a custom function to call for importing products from Yahoo.
EditCustomerForm Form to open when user clicks Add or Edit at View Customers form.
HoursToGMT Number of hours to add or subtract to get to Greenwich Mean Time
PackingFormFilter Normally left blank. Sets special filter for use at Packing Form. Example: Option10=’ID’
ShowHiddenParms Show special parameters that are only required for custom installations?
SpecialMenu An entry here adds a button to the Main Menu, provides the caption for the button, and is also the name of the form to open when the button is clicked
SRUsePriceOffer Custom Parameter for one client. Leave set to False!
StartupHideToolbars Set to TRUE to hide all of Access’ toolbars
StartupMenuBar Name of the menu bar to display. Should usually be empty. To hide the standard Access menu bar, set it to “Order Manager Menu” (without the quotes).
StripHTMLFromName Remove HTML tags from Product Names as they are imported from your shopping cart?
StripSKU For special sites that have Supplier ID in parentheses at end of each SKU
StripSKUDelimiter Order Manager will strip any characters to the left of the character entered here from an incoming SKU prior to building sub-SKUs.
ViewCustomersForm Form to open when user clicks View Customers at Main Menu
Updated on November 3, 2021

Was this article helpful?

Related Articles