eLabSDK2.Inventory.Barcode

Hierarchy

  • default

    Barcode

Methods

onBarcodeActionTriggered

Static onBarcodeActionTriggered(callback, id): void

Register a callback to execute when a barcode action is triggered in the inventory module.

This event fires when a user initiates a barcode-related action in the inventory system, such as clicking a "Print Barcode" button, opening a barcode scanner dialog, or other barcode-specific operations. Use this to integrate custom barcode handling, track barcode usage, or trigger additional workflows when users interact with barcode features.

Parameters

NameTypeDescription
callbackVoidCBFunction to execute when a barcode action is triggered.
idstringUnique identifier for this callback registration.

Returns

void

Example

// Log when barcode actions are triggered
eLabSDK2.Inventory.Barcode.onBarcodeActionTriggered(() => {
  console.log('Barcode action triggered by user');
  trackAnalytics('barcode_action_used');
}, 'track-barcode-actions');

Example

// Show custom UI when barcode action starts
eLabSDK2.Inventory.Barcode.onBarcodeActionTriggered(() => {
  showBarcodeInstructions();
}, 'show-barcode-help');

onBarcodeReceived

Static onBarcodeReceived(callback, id): void

Register a callback to execute when a barcode is successfully scanned in the inventory module.

This event fires when a barcode for a sample, sample series, or storage unit has been scanned and received by the system. The scanned barcode can be from a hardware barcode scanner, mobile device camera, or manual input. Use this to trigger custom workflows, validate barcodes, integrate with external systems, or perform actions based on the scanned inventory item.

Parameters

NameTypeDescription
callbackVoidCBFunction to execute when a barcode is received.
idstringUnique identifier for this callback registration.

Returns

void

Example

// Log scanned barcodes
eLabSDK2.Inventory.Barcode.onBarcodeReceived(() => {
  console.log('Barcode scanned successfully');
  // Note: To access the actual barcode value, you may need to query the current state
  trackBarcodeScanning();
}, 'log-barcode-scans');

Example

// Trigger custom validation
eLabSDK2.Inventory.Barcode.onBarcodeReceived(() => {
  validateScannedBarcode();
  showConfirmationMessage();
}, 'validate-barcode');

Example

// Integrate with external system
eLabSDK2.Inventory.Barcode.onBarcodeReceived(async () => {
  await syncBarcodeWithExternalLIMS();
  eLabSDK2.UI.Toast.showToast('Barcode synced', 2000);
}, 'sync-barcode');

© 2023 eLabNext