Acumatica Automation Screens
Introduction
Automation screens in Acumatica allow you to create powerful batch processing solutions that can handle large volumes of data efficiently. Whether you need to process transactions, generate reports, or perform data migrations, automation screens provide the framework you need.
In this guide, we'll explore how to create and implement automation screens in Acumatica, covering processing screens, queues, and batch operations.
Automation Overview
Acumatica automation screens come in several types:
- Processing Screens - Execute operations on selected records
- Mass Update Screens - Update multiple records at once
- Import Screens - Import data from external sources
- Export Screens - Export data for external use
- Scheduler Screens - Schedule automated tasks
Each type serves different purposes and can be customized to meet specific business requirements.
Creating Automation Screens
Let's create a simple processing screen for mass-updating customer status. First, define the processing DAC:
public class CustomerProcess : IPrefetchable
{
public int? CustomerID { get; set; }
public string CustomerCD { get; set; }
public string CustomerName { get; set; }
public string Status { get; set; }
public bool Selected { get; set; }
}
Create the processing graph:
public class CustomerProcessMaint : PXGraph
{
public PXFilter Filter;
public PXProcessing>> Customers;
public PXAction ProcessAll;
[PXButton]
protected void processAll()
{
foreach (CustomerProcess row in Customers.Cache.Updated)
{
UpdateCustomerStatus(row);
}
}
}
Processing Queues
For long-running operations, use processing queues to manage workloads:
public class ProcessingQueueMaint : PXGraph
{
public PXSelect Queue;
public delegate void ProcessQueueItem(ProcessingQueue item)
{
// Process each item
// Update progress
// Handle errors
}
}
Processing queues provide:
- Progress tracking
- Error handling and retry logic
- Parallel processing capabilities
- Transaction management
Batch Processing
Implement efficient batch processing with proper transaction handling:
protected void ProcessBatch()
{
using (var ts = new PXTransactionScope())
{
foreach (var batch in GetBatchesToProcess())
{
try
{
ProcessBatch(batch);
UpdateBatchStatus(batch, "Completed");
}
catch (Exception ex)
{
UpdateBatchStatus(batch, "Failed");
LogError(ex);
}
}
ts.Complete();
}
}
Best practices for batch processing include:
- Use appropriate batch sizes
- Implement checkpoint/restart capability
- Log progress and errors
- Handle transactions properly
Best Practices
- Test with small datasets - Verify logic before production
- Implement progress indicators - Keep users informed
- Handle errors gracefully - Log errors and continue processing
- Use transactions appropriately - Balance performance and consistency
- Provide rollback capabilities - Allow reverting changes
- Monitor performance - Track processing times
Summary
Automation screens are essential for handling bulk operations efficiently in Acumatica. By following these patterns and best practices, you can create robust processing solutions that handle large data volumes reliably.
For more information, check out our other tutorials on Workflow Automation and Customization Basics.