BxAdmin - Overriding configuration parameters in SQL queries

Using cfg_, you can override many Client Profiles and Export Config parameters

  1. Introduction
  2. Procedure
  3. Example 1 - Overriding printers
    1. Example of overriding shipping label printer based on order marking
    2. Example of overriding shipping label printer based on terminal
    3. Example of overriding packing slip prints and template
  4. Example 2 - Overriding the shipping system
  5. Example 3 - Controlling configuration based on selected employee on terminal

Introduction

Sometimes, you may need to override various settings, such as which printers to use for printing shipping labels and packing slips, or which packing slip template to use. These overrides can be based on certain values in the ERP system, which handheld terminal the printer is connected to, etc.  

In principle, you can override all configuration parameters found under Client Profiles and Export to ERP → Export config - the possibilities are endless as long as you have a good understanding of SQL queries and know what each parameter does. However, not all parameters are suitable for overriding, so some should be carefully considered to determine whether it is practical to implement in a good way, or not. The examples in this article mostly focuses on overriding different print settings.

Procedure

To override settings, use cfg_ before the name of the setting in BxAdmin within the SQL query for the relevant module. The examples in this article are based on setups for Visma Business and VismaNet, along with different shipping systems. The cfg_ parameter is added to the SQL query for the module where the override is intended.

Example 1 - Overriding printers

In BxAdmin under Configuration → Client Profiles → Area: consignor, there is a parameter called shipmentlabelprinter, which is typically filled with the name of the print queue for printing labels. In this case, it is set to 'Zebra ZD420 Showroom'.

If you want to override this based on a certain customer or other markings in the ERP system, or based on the terminal used for picking, you can add cfg_shipmentlabelprinter to the SQL query with the parameter that determines which printer to use, and the name of the print queue. Cfg_ is the prefix used in the query to override the specific SQL query setting.

The same principle can be used to override the printer for packing slip printouts, or which packing slip template should be used.

Example of overriding shipping label printer based on order marking

Let us say the 'Label' field in the order header in Visma Business determines which printer the printout should go to. In this case, we want to use a Honeywell printer for printing, and the value in the 'Label' field is set to, for example, 'Plukkestasjon2'. We set up the value in the ERP system as 'Plukkestasjon2', meaning we want to print to 'Honeywell PC42d Plukkestasjon2' instead of 'Zebra ZD420 Showroom'. It is important to add an 'else' fallback in the query so that it prints to the default printer if no other condition is met.

It is not necessary to have the original print queue name in the Client Profile shipmentlabelprinter setup, but it is still useful to keep it there if it was previously set.

If you want to control more printers, you can add more 'when' lines in the query, in this case, we have also included a TSC printer.

case 
when o.label = 'Plukkestasjon2' then 'Honeywell PC42d Printerrom'
when o.label = 'Plukkestasjon3' then 'TSC Kontor'
else 'Zebra ZD420 Showroom'
end cfg_shipmentlabelprinter

The query in BxAdmin will eventually look like this:  

As long as the printers are available for the BxEngine service and the print queue names are correct, this should work immediately on the next order you pick. The only thing left is testing to confirm that everything works as expected.

Example of overriding shipping label printer based on terminal

To override the printer based on the terminal used for picking, you can set an ID on an available field on the device in Devices. In this case, we use ERPCustomerNo. Retrieve the correct column and set a numeric value in it. This value will be used in the query to determine which printer to use.

The query should look like this: 

case
  when isnull('#erpcustomerno#','') = '2' then 'Honeywell PC42d Printerrom'
  when isnull('#erpcustomerno#','') = '3' then 'TSC Kontor'
  else 'Zebra ZD420 Showroom'
end cfg_shipmentlabelprinter

When setting a value on the terminal in ERPCustomerNo, it is necessary to retrieve terminal settings afterwards to activate the setup.

Example of overriding packing slip prints and template

Here, we use Visma Business as an example, as this is one of the systems that allows us to change the packing slip template. The integration method is VBS.

In Configuration → Client Profiles → Area: pickinglist, there are four parameters that control the packing slip printout from Visma Business: print, printfromvb, reportno and vbprintername. In the case of VismaNet, for example, the packing slip printer parameter is located under the exporter in Export to ERP → pickinglist → Export config. The same principle applies here with cfg_printer, as this parameter is also named printer.
image-png-Sep-17-2020-02-36-08-00-PM.png (670×29)
image-png-Sep-17-2020-02-35-29-35-PM.png (582×289)
All of these can be used with cfg_ in the pickinglist query. The most relevant ones in this case are print, reportno, and vbsprintername.

The query is built in the same way as for shipping label printers. For example, if you have set parameters in Visma that tell you that a specific order should not have a packing slip printed, you can also choose to prevent packing slip printing from being triggered. In the query below, we have set up several combinations of these parameters. Let us say ord.inf3 = 1 means that the order should not have a packing slip printed, ord.inf4 = 1 means that the order should use a different packing slip template, and the terminal determines which printer the packing slip printout will be sent to.

case
  when o.inf3 = '1' then 'false'
  else 'true'
end cfg_print,
case
  when o.inf4 = '1' then '1008'
  else '127'
end cfg_reportno,
case
  when isnull('#erpcustomerno#','') = '2' then 'HP plukkestasjon2'
  when isnull('#erpcustomerno#','') = '3' then 'HP plukkestasjon3'
  else 'HP Lager'
end cfg_vbprintername

The result of the query should then look something like this. Notice that the printer name has not changed, as only the terminals retrieve the correct printers based on what is set up in the query  and the erpcustomerno field on the device is for that terminal.

Example 2 - Overriding the shipping system

In some cases, you may have multiple setup configurations in the shipping system, for example, if you have customers with specific requirements for the sender or shipping provider, which do not align with the setup used for other customers or shipping agreements. In these cases, you may have several actors in the setup.

You can override with different values for these (including printers, as explained earlier):

  • AxiaFrakt - cfg_actorid and cfg_senderid
  • Logistra - cfg_actorid and cfg_serverkey
  • Shipment Server - cfg_actorid and cfg_serverkey
  • Unifaun Online - cfg_serverkey
  • Consignor On-premises - cfg_exportfilepath and cfg_importfilepath – this applies if you have multiple Import and Export Setups in Consignor with different file paths. Here, the file path should be overridden.

These can also be combined with cfg_ on printproxy and printproxylicensekey if, for example, printer number 2 is located in a different location without direct network connection, where BxSmartPrintPro is used as a print proxy.

Example 3 - Controlling configuration based on selected employee on terminal

It is also possible to control printers and other parameters by employee/user selected at the terminal. This is managed in the employee query under SQL Integration → Employee.

Example query – here we want to control the printer per employee in the Picking module, so we set up cfg_pickinglist_printer, which controls the configuration for the picking list routine/module, with the printer setting under it. The same applies for receiving with cfg_receivelist_printer. If you want to control the same parameter for all modules supporting this, you can also just add cfg_printer.

select 
    employee, 
    isnull(firstname + ' ', '') + isnull(middlename + ' ', '') + isnull(lastname, '') employeename,
    case 
        when employee = 00003 then 'Printer00003'
        when employee = 00001 then 'Printer00001'
        else 'Standard printer' 
  end cfg_pickinglist_printer, --styrer print kun for Plukk.
    case 
  when employee = 00003 then 'Printer00003'
        when employee = 00001 then 'Printer00001'
        else 'Standard printer' 
  end cfg_receivelist_printer --styrer print kun for Mottak.
  case 
  when employee = 00003 then 'Printer00003'
        when employee = 00001 then 'Printer00001'
        else 'Standard printer' 
end cfg_printer --styrer print for alle moduler med dette parameteret.
from 
    BxEmployee 
where 
    status like 'Active' 
order by 
    employeename