ScanEntryMgt220FDW
Codeunit for managing mobile scan entry records -- creating, querying, updating status, and calculating aggregated quantities. This is the primary API for interacting with Mobile Scan Entry 220FDW records from workflow step handlers and service codeunits.
Overview
- Object type: Codeunit
- Object ID: 73167902
- Namespace:
Aptean.Mesh.SDUI - Permissions:
tabledata "Mobile Scan Entry 220FDW" = rimd
Methods
InsertScanEntry
procedure InsertScanEntry(
ItemNo: Code[20];
LocationCode: Code[10];
VariantCode: Code[10];
SourceType: Integer;
SourceSubtype: Integer;
SourceID: Code[20];
SourceBatchName: Code[20];
SourceProdOrderLine: Integer;
SourceRefNo: Integer;
LotNo: Code[50];
SerialNo: Code[50];
Quantity: Decimal;
UnitOfMeasureCode: Code[10];
QtyPerUnitOfMeasure: Decimal;
ExpirationDate: Date;
BinCode: Code[20]
): BigInteger
Creates a new scan entry record in Pending status and returns the assigned entry number.
Parameters:
| Name | Type | Description |
|---|---|---|
ItemNo | Code[20] | The item number |
LocationCode | Code[10] | The warehouse location code |
VariantCode | Code[10] | The item variant code (blank if none) |
SourceType | Integer | Source document table ID (e.g., Database::"Warehouse Activity Line") |
SourceSubtype | Integer | Source document subtype |
SourceID | Code[20] | Source document number |
SourceBatchName | Code[20] | Source batch name |
SourceProdOrderLine | Integer | Source production order line number |
SourceRefNo | Integer | Source reference line number |
LotNo | Code[50] | Lot/batch number (blank if not tracked) |
SerialNo | Code[50] | Serial number (blank if not tracked) |
Quantity | Decimal | Scanned quantity in the specified UOM |
UnitOfMeasureCode | Code[10] | Unit of measure code |
QtyPerUnitOfMeasure | Decimal | Conversion factor (UOM to base) |
ExpirationDate | Date | Expiration date (0D if not applicable) |
BinCode | Code[20] | Warehouse bin code (blank if not assigned) |
Returns: BigInteger -- the Entry No. of the newly created scan entry.
Example:
var
ScanEntryMgt: Codeunit ScanEntryMgt220FDW;
EntryNo: BigInteger;
begin
EntryNo := ScanEntryMgt.InsertScanEntry(
'ITEM-001', // ItemNo
'WAREHOUSE-01', // LocationCode
'', // VariantCode
Database::"Warehouse Activity Line", // SourceType
1, // SourceSubtype (Inbound)
'WHSE-RCV-001', // SourceID
'', // SourceBatchName
0, // SourceProdOrderLine
10000, // SourceRefNo
'LOT-2026-001', // LotNo
'', // SerialNo
10, // Quantity
'PCS', // UnitOfMeasureCode
1, // QtyPerUnitOfMeasure
20261231D, // ExpirationDate
'BIN-A-01' // BinCode
);
end;
CalculateScanQuantity
procedure CalculateScanQuantity(
SourceType: Integer;
SourceSubtype: Integer;
SourceID: Code[20];
SourceRefNo: Integer
): Decimal
Returns the total Quantity of all pending scan entries for a given source document line.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceSubtype | Integer | Source document subtype (0 is treated as unfiltered) |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
Returns: Decimal -- the summed quantity in the document's unit of measure.
CalculateScanQuantityBase
procedure CalculateScanQuantityBase(
SourceType: Integer;
SourceSubtype: Integer;
SourceID: Code[20];
SourceRefNo: Integer
): Decimal
Returns the total Quantity (Base) of all pending scan entries for a given source document line.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceSubtype | Integer | Source document subtype (0 is treated as unfiltered) |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
Returns: Decimal -- the summed quantity in the base unit of measure.
CalculateScanQuantityForLot
procedure CalculateScanQuantityForLot(
SourceType: Integer;
SourceSubtype: Integer;
SourceID: Code[20];
SourceRefNo: Integer;
LotNo: Code[50]
): Decimal
Returns the total Quantity (Base) of all pending scan entries for a specific lot on a source document line.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceSubtype | Integer | Source document subtype (0 is treated as unfiltered) |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
LotNo | Code[50] | Lot/batch number to filter by |
Returns: Decimal -- the summed base quantity for the specified lot.
GetPendingScanQtyForBinItem
procedure GetPendingScanQtyForBinItem(
LocationCode: Code[10];
BinCode: Code[20];
ItemNo: Code[20];
VariantCode: Code[10];
LotNo: Code[50]
): Decimal
Returns the total Quantity (Base) of all pending scan entries for a specific item in a specific bin. Only counts entries with Source Type = Warehouse Activity Line.
Parameters:
| Name | Type | Description |
|---|---|---|
LocationCode | Code[10] | Warehouse location code |
BinCode | Code[20] | Bin code to filter by |
ItemNo | Code[20] | Item number to filter by |
VariantCode | Code[10] | Item variant code to filter by |
LotNo | Code[50] | Lot number (blank to include all lots) |
Returns: Decimal -- the summed base quantity.
Example:
var
ScanEntryMgt: Codeunit ScanEntryMgt220FDW;
PendingQty: Decimal;
begin
// Check how much of ITEM-001 is pending in BIN-A-01
PendingQty := ScanEntryMgt.GetPendingScanQtyForBinItem(
'WAREHOUSE-01',
'BIN-A-01',
'ITEM-001',
'', // all variants
'LOT-2026-001' // specific lot
);
end;
SetPendingEntriesStatus
procedure SetPendingEntriesStatus(
SourceType: Integer;
SourceID: Code[20];
SourceRefNo: Integer;
NewStatus: Enum "Scan Entry Status 220FDW"
)
Bulk-updates the status of all pending scan entries for a given source document line.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
NewStatus | Enum "Scan Entry Status 220FDW" | The new status to assign |
Example:
var
ScanEntryMgt: Codeunit ScanEntryMgt220FDW;
begin
// Mark all pending entries as transferred after successful registration
ScanEntryMgt.SetPendingEntriesStatus(
Database::"Warehouse Activity Line",
'WHSE-RCV-001',
10000,
Enum::"Scan Entry Status 220FDW"::Transferred
);
end;
SoftDeletePendingEntries
procedure SoftDeletePendingEntries(
SourceType: Integer;
SourceID: Code[20];
SourceRefNo: Integer
)
Marks all pending scan entries for a source document line as Deleted. This is a convenience wrapper around SetPendingEntriesStatus with the Deleted status.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
HasPendingEntriesWithoutBin
procedure HasPendingEntriesWithoutBin(
SourceType: Integer;
SourceID: Code[20];
SourceRefNo: Integer
): Boolean
Checks whether any pending scan entries exist for a source line that have no bin code assigned. This is used to determine if a bin assignment step is needed before registration.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
Returns: Boolean -- true if there are pending entries with a blank bin code.
GetPendingEntryForLine
procedure GetPendingEntryForLine(
SourceType: Integer;
SourceID: Code[20];
SourceRefNo: Integer;
var ScanEntry: Record "Mobile Scan Entry 220FDW"
): Boolean
Finds the first pending scan entry for a source document line.
Parameters:
| Name | Type | Description |
|---|---|---|
SourceType | Integer | Source document table ID |
SourceID | Code[20] | Source document number |
SourceRefNo | Integer | Source reference line number |
ScanEntry | Record "Mobile Scan Entry 220FDW" (var) | Output -- the found scan entry record |
Returns: Boolean -- true if a pending entry was found, with ScanEntry positioned on it.
Example:
var
ScanEntryMgt: Codeunit ScanEntryMgt220FDW;
ScanEntry: Record "Mobile Scan Entry 220FDW";
begin
if ScanEntryMgt.GetPendingEntryForLine(
Database::"Warehouse Activity Line",
'WHSE-RCV-001',
10000,
ScanEntry
) then
// Process the pending scan entry
Message('Found pending entry %1 for item %2', ScanEntry."Entry No.", ScanEntry."Item No.");
end;
TransferScanEntry
procedure TransferScanEntry(
var ScanEntry: Record "Mobile Scan Entry 220FDW";
BinCode: Code[20]
)
Marks a scan entry as Transferred and assigns a bin code. Use this when registering a scan entry to a warehouse activity line.
Parameters:
| Name | Type | Description |
|---|---|---|
ScanEntry | Record "Mobile Scan Entry 220FDW" (var) | The scan entry to transfer |
BinCode | Code[20] | The bin code to assign |
AssignBinToScanEntry
procedure AssignBinToScanEntry(
var ScanEntry: Record "Mobile Scan Entry 220FDW";
BinCode: Code[20]
)
Assigns a bin code to a scan entry without changing its status. Use this when the bin is determined after the initial scan (e.g., during a put-away workflow).
Parameters:
| Name | Type | Description |
|---|---|---|
ScanEntry | Record "Mobile Scan Entry 220FDW" (var) | The scan entry to update |
BinCode | Code[20] | The bin code to assign |
Typical Workflow
The following illustrates how ScanEntryMgt220FDW is used in a receive workflow:
// 1. User scans item, lot, quantity -- create a pending entry
EntryNo := ScanEntryMgt.InsertScanEntry(...);
// 2. Check total scanned quantity against expected
ScannedQty := ScanEntryMgt.CalculateScanQuantityBase(
SourceType, SourceSubtype, SourceID, SourceRefNo);
if ScannedQty >= ExpectedQtyBase then
// Ready to register
// 3. After successful registration, mark entries as transferred
ScanEntryMgt.SetPendingEntriesStatus(
SourceType, SourceID, SourceRefNo,
Enum::"Scan Entry Status 220FDW"::Transferred);
// 4. If user cancels, soft-delete the entries
ScanEntryMgt.SoftDeletePendingEntries(SourceType, SourceID, SourceRefNo);