EAImportItemsFromLongTextField
This document was generated using Claude.ai
Overview
Imports items into a supply chain document by parsing item codes from a long text field. Reads item codes separated by line breaks, looks up the corresponding items, and creates document lines with quantity 1 for each item. If an item already exists in the document, increments its quantity instead.
When This Action Runs
Manual execution when bulk item entry is needed from a text list, typically for quick document creation from barcode scans, item lists, or when importing items from external sources that provide code lists.
How It Works
- Reads source field - Extracts text from specified field (defaults to remarks field)
- Parses item codes - Splits text by line breaks to get individual item codes
- Clears existing lines - Removes current document lines (reuses existing line objects)
- Processes each code - Trims whitespace and skips empty lines
- Looks up items - Finds InvItem records using business codes
- Creates/updates lines - Adds new lines or increments quantity for existing items
- Sets default values - Assigns quantity 1 and primary unit of measure
Parameters
Parameter 1: Source Field Name (Optional) - Field containing item codes (default: "remarks")
The field should contain item codes separated by line breaks, for example:
ITEM001
ITEM002
ITEM003
Database Tables Affected
- Document Lines - Replaces existing lines with new lines based on item codes
- InvItem - Reads item master records using business codes (read-only)
Module: supplychain
Full Class Name: com.namasoft.modules.supplychain.domain.utils.plugnplay.EAImportItemsFromLongTextField