Custom Hooks

What are Custom Hooks?

Custom Hooks allow you to execute custom code at various points in the Stone Edge Order Manager (SEOM) without modifying the original source code. They are commonly used to trigger custom functions within a module and can also load alternatives to built-in forms. These hooks reference code stored in a custom module database, which resides outside of SEOM’s native source code. When invoked, the hooks automatically merge the custom code into SEOM on demand.


Example Uses of Custom Hooks

Example 1: Running a Promotion You’re running a promotion where customers receive a free t-shirt for any order over $100. You can create a custom module to check orders and automatically add the free t-shirt line item to qualifying orders. In this scenario, you could use either the “CustomAfterImportCall” or “CustomAfterProcessOrderCall” parameters. After orders are imported or processed, SEOM will trigger the custom function specified by one of these parameters.

Example 2: Reducing Packing Errors A merchant wants to reduce claims of incomplete shipments by photographing the contents of each package before sealing. They mount a GoPro camera above the packing station scales and use the GoPro API to capture images of each box. The “CustomAfterReadScale” hook is used to trigger the GoPro when the scale reads the package weight, saving the image to the order in SEOM.


Commonly Used Hooks

Order-Related Hooks

  • After Automatic Order Approval
  • After Manual Order Approval
  • After Saving a Manual Order
  • After Importing Orders
  • After Processing Imported Orders
  • Before Status Updates
  • Custom Order Import Function
  • Custom Shipping Rate Lookup

Shipping-Related Hooks

  • After Importing Tracking Numbers
  • After Packing a SKU
  • After Reading a Scale when Packing an Order
  • Carrier Pack and Ship Call

Inventory-Related Hooks

  • 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

1. Identify Which Custom Hook to Use Custom Hooks are defined by system parameters, typically found in the “Custom” parameter group. Most hooks begin with the word “Custom” (e.g., “CustomAfterProcessOrderCall” or “CustomFillBackordersCall”). The parameter name provides a clue to the hook’s functionality, and more details are available in the Parameter Details box.

2. Write and Save Your Custom Code Once your custom code is written, export the module to a Microsoft Access database located in the same directory as your SEOM data file.

3. Configure SEOM to Use a Custom Function with a Hook

  • CustomModuleName: This is the name of the code module containing your custom hook. It’s recommended to include part of your company name for easy identification and uniqueness (e.g., “SEMailFunctions” or “SESendMail”).
  • CustomModuleDatabase: This is the Microsoft Access database containing the custom modules. It should be stored in the same location as your SEOM data file.
    • Tip: This can be the same database as your Custom Reports database.
  • Set the Parameter Text value of the hook to the name of your custom function.

4. Configure SEOM to Use a Custom Form with a Hook

  • CustomFormDatabase: Similar to the module database, this is the name of the Microsoft Access database containing your custom forms, stored in the same location as your SEOM data file.
    • Tip: This can be the same database as your Custom Reports database.
  • Set the Parameter Text value of the hook to the name of your custom form.

Tips and Tricks

  • If a hook expects a function but you need to load a custom form, use the DoCmd.OpenForm procedure to launch your custom form.
  • Always test your customizations in a local copy of SEOM first. Make sure the code compiles successfully before deploying it to other PCs.
  • Some hooks replace built-in forms or modules (e.g., “CustomProcessOrderCall”), while others supplement them (e.g., “CustomAfterProcessOrderCall”). Be sure to review the parameter details to understand how each hook functions.

 

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 October 3, 2024

Was this article helpful?

Related Articles