Table of Contents

Advanced Transaction Search

The Advanced Transaction Search functionality enhances the Transaction Lookup capabilities on the POS by allowing users to search for transactions using various criteria beyond the standard LS Central criteria. The standard LS Central behaviour is to only allow a remote lookup by Receipt Barcode otherwise it allows a selection/search on the local Transaction Header table via a standard lookup page. This presents challenges when trying to find a specific transaction without the receipt barcode or when you are in a distributed/multi-company evnironment where the transaction may exist in a different company than the one you are currently operating in on the POS.

With this enhancements, users can search for transactions in either the local or central company using a variety of criteria such as:

Criteria Notes
Receipt No. From Transaction Header
Store No. From Transaction Header
POS Terminal No. From Transaction Header
Transaction No. From Transaction Header
Transaction Date From Transaction Header
Item No. From any Transaction Sales Entry
Barcode From any Transaction Sales Entry
Name From Member Contact attached to the transaction
Address From Member Contact attached to the transaction
Email From Member Contact attached to the transaction
Card Number From Membership Card attached to the transaction
Phone No. From Member Contact attached to the transaction
Contact No. From Member Contact attached to the transaction
Global Dimension 1 Code From Store associated to Transaction Header
Order No. From the Customer Order associated to the transaction

Results from the search will be displayed in a list on the POS and users can select the desired transaction to view the details or perform actions such as returns or reprints.

How it works

When the user runs the DW_TRANSQ command on the POS, it opens the Advanced Transaction Search panel (DW-TRANSQUERY) where they can enter their search criteria. When they execute the search, the criteria is passed to the DXWLSTransactionQuery web service which performs the search based on the criteria entered and returns results to be displayed in a lookup page on the POS. The user can then select a transaction from the results to view more details or perform actions on that transaction.

Setup and Configuration

To enable the Advanced Transaction Search functionality, the following setup is required:

  1. Navigate to the POS Power Tools Setup page via the Tell-Me search or from the Manual Setup menu in Business Central.
  2. In the POS Power Tools Setup page, choose the Register POS Commands action under the Action menu. This will register the necessary POS commands and create the POS data for the Advanced Transaction Search functionality to work. Note that this is a one-time action and does not need to be repeated unless you want to re-register the commands for any reason (e.g. after an update).
  3. Once the POS commands are registered, the Advanced Transaction Search functionality will be available on the POS via the DW_TRANSQ command. You can add this command to a button on the POS to access it. When you run the command, it will open the Advanced Transaction Search panel where you can enter your search criteria and view the results.
Tip

You can also register the POS commands and generate the necessary data by registering Codeunits "DXWLS POSCommands" and DXWLSTransactionQuery in the LS Central POS External Commands or LS Central POS Module pages via the Register action. You can also invoke the codeunits directly to register the commands via code by passing a LSC POS Menu Line record with the "Registration Mode" field set to True.

Specifically, the following POS Data is generated when you register the POS commands for this functionality:

  • POS Data Table: DW-TRANSQUERY
    • Temporary table used to store search criteria entered by the user on the Advanced Transaction Search panel on the POS. Linked to the DXWLS Transaction Finder table as a buffer to capture the search criteria entered by the user and then used to return results based on that criteria.
  • POS Record Zoom: DW-TRANSQUERY
    • POS Control to capture the search criteria entered by the user on the Advanced Transaction Search panel on the POS, assoicated to the DW-TRANSQUERY data table
  • POS Menu: DW-TRANSQUERY
    • Menu with functions to be displayed on the Advanced Transaction Search panel on the POS
  • POS Buttonpad: DW-TRANSQUERY
    • Buttonpad to hold the DW-TRANSQUERY menu, to be displayed on the Advanced Transaction Search panel on the POS
  • POS Panel: DW-TRANSQUERY
    • Panel displayed on the POS when the user runs the DW_TRANSQ command, contains the DW-TRANSQUERY record zoom and DW-TRANSQUERY buttonpad.
  • POS Data Table: DW-TRANSQUERYLIST
    • Temporary data table used to store and display results of the Advanced Transaction Search on the POS
  • POS Lookup: DW-TRANSQUERYLIST
    • Lookup page used to display results of the Advanced Transaction Search on the POS
  • Web Service: DXWLSTransactionQuery
    • Web Service used to execute the search for transactions based on the criteria entered by the user on the Advanced Transaction Search panel on the POS, returns results to be displayed in the DW-TRANSQUERYLIST lookup page on the POS. This webservice is registered in the LS Central Web Requests 2.0 list as well as the Business Central Web Services list. This exposes Codeunit DXWLSTransactionQuery as a Business Centralweb service.
  • POS Command: DW_TRANSQ
    • Opens the Advanced Transaction Search panel on the POS

Extending the Search Functionality

The Advanced Transaction Search functionality is designed to be extensible, allowing for additional search criteria to be added as needed. To extend the search functionality, you can use extensibility events to manipulate search criteria, add new criteria, and establish defaults or hard filters.

The following extensibility events are available to allow for extension of the search functionality:

  • OnAfterInitSearchDefaults: Triggered after the default search criteria has been initialized, allowing for manipulation of the default criteria or addition of new criteria.
  • OnAfterApplyTransactionQueryFilters: Triggered after the search criteria has been applied to the transaction query, allowing for additional filters to be applied based on the search criteria entered by the user.

Example: Filtering by Global Dimension 1

When having multiple banners or operating in a distributed environment, it can be helpful to filter transactions by a specific global dimension value such as a region or banner to restrict the returns or search results to only those relevant to that specific Banner. Using the extensibility events mentioned above, you can add a new search criteria for Global Dimension 1 Code and then apply a filter to the transaction query based on the value entered for that criteria.

You would add a new default value for Global Dimension 1 Code by subscribing to the OnAfterInitSearchDefaults event. In this event, you can populate the Transaction Finder record with the Global Dimension 1 Code from the Store record for the current POS Session. By ensuring the Global Dimension 1 Code field is not available on the POS Data Table or Record Zoom, this will act as a hidden criteria that is automatically populated based on the store the user is operating in and will filter results to only those transactions relevant to that store's banner/region.

codeunit 50100 MyTransactionSearchExtensions {
[EventSubscriber(ObjectType::Codeunit, Codeunit::"DXWLSTransactionQuery", 'OnAfterInitSearchDefaults', '', false, false)]
local procedure AddGlobalDimension1SearchCriteria(var TransactionFinder: record "DXWLS TransactionFinder) 
var
    POSSession: Codeunit: "LSC POS Session";
    Store: Record "LSC Store";
begin
    // Get the store record for the current session
    Store.Get(POSSession.StoreNo());
    // Populate the Global Dimension 1 Code search criteria based on the store associated to the transaction
    TransactionFinder."Global Dimension 1 Code":= Store."Global Dimension 1 Code";        
end;
}