EAEGBRASSFixCreationDates
This document was generated using Claude.ai
Overview
Bulk fixes creation dates on supply chain documents identified by SQL query. Synchronizes creation dates with source documents and adjusts them based on document type (issues vs receipts) to maintain proper chronological order for inventory effects.
When This Action Runs
Manual execution for data correction when creation dates are incorrect or inconsistent, typically after data migration, system integration issues, or when documents need chronological reordering for accurate inventory processing.
How It Works
- Executes SQL query - Finds documents to process based on query criteria
- Synchronizes with source - Copies creation date from source document (fromDoc) if available
- Adjusts chronological order - For StockIssue: makes creation date after source; for others: makes creation date before source
- Regenerates inventory effects - Recalculates inventory transactions with corrected dates
- Processes in sequence - Handles each document individually with error accumulation
Parameters
Parameter 1: Query (Required) - SQL query returning entityType and id columns
select entityType,id from StockIssue where fromDoc_id = {id}
Parameter 2: Flush Before Starting (Optional) - true/false to flush database before processing (default: false)
Parameter 3: Skip Cancelled Records (Optional) - true/false to ignore cancelled documents (default: true)
Parameter 4: Flush After Each Fix (Optional) - true/false to flush after each document (default: false)
Parameter 5: Continue on Errors (Optional) - true/false to process remaining documents if errors occur (default: false)
Parameter 6: Pre-Processing Update (Optional) - SQL update query to run before fixing dates
Database Tables Affected
- Supply Chain Documents - Updates creation dates on target documents
- Inventory Transactions - Regenerates inventory effects with new dates
- Document Relationships - Reads source document dates (read-only)
Module: supplychain
Full Class Name: com.namasoft.modules.supplychain.domain.utils.plugnplay.EAEGBRASSFixCreationDates
Parent Class: EARecommitFromQuery
Related Actions:
- EARecommitFromQuery - Parent class for bulk operations
- EAMakeCreationDateAlwaysAfter - Used for StockIssue documents
- EAMakeCreationDateAlwaysBefore - Used for other documents