Infor SyteLine

UpdateCollection Patterns for SyteLine CRUD Operations

UpdateCollection is the IDO operation responsible for all data modifications in SyteLine. Every form save, every integration write, and every background process that creates or modifies records uses UpdateCollection under the hood. Understanding how to construct UpdateCollection requests correctly ensures data integrity, proper transaction handling, and reliable error recovery across your SyteLine customizations.

Building Insert, Update, and Delete Commands

An UpdateCollectionRequestData contains an IDOCommands collection with one or more typed commands. InsertCommand creates new rows by specifying property-value pairs for each column. UpdateCommand modifies existing rows identified by primary key properties. DeleteCommand removes rows using the key values. Each command maps directly to a SQL INSERT, UPDATE, or DELETE statement after the IDO Runtime applies security checks and extension class logic. You can mix command types in a single request, and the runtime executes them within a single database transaction.

  • InsertCommand: set each property via cmd.SetPropertyValue("PropertyName", value) before adding to IDOCommands
  • UpdateCommand: include the primary key property (e.g., RowPointer) plus only the changed properties
  • DeleteCommand: requires only the primary key property values to identify the target row
  • Multiple commands execute in order within a single transaction: all succeed or all roll back
  • Use cmd.SetLinkBy(parentProperty, childProperty) for parent-child inserts in hierarchical IDOs

Transaction Handling and Concurrency

SyteLine uses optimistic concurrency control through the RowPointer and InWorkflow columns. When you issue an UpdateCommand, the IDO Runtime checks that the RowPointer matches the current database value. If another user modified the row between your LoadCollection and UpdateCollection, the runtime throws a concurrency exception. Handle this by catching the exception, reloading the current data, presenting the conflict to the user, and resubmitting. For batch integrations, implement retry logic with exponential backoff to handle transient concurrency conflicts gracefully.

  • Always include RowPointer in UpdateCommand properties for optimistic concurrency checking
  • Catch IDOException with error code 1001 for concurrency conflicts and implement reload-retry logic
  • For multi-row batch updates, consider breaking large batches into chunks of 50-100 commands
  • Use IDOTransaction scope for cross-IDO operations that must succeed or fail atomically
  • Monitor deadlock frequency in SQL Server: frequent deadlocks indicate transaction scope issues

Error Handling in UpdateCollection Operations

UpdateCollection errors fall into three categories: validation errors from extension class logic, constraint violations from the database layer, and infrastructure errors from connection or timeout issues. Extension class validation errors return structured IDOMethodException messages that can be displayed directly on the form. Database constraint violations (unique key, foreign key, check constraint) surface as IDOException with the underlying SQL error. Infrastructure errors require retry logic and connection recovery. Always wrap UpdateCollection calls in try-catch blocks and log the full exception chain for debugging.

  • Extension validation errors: catch IDOMethodException and display the Message property to the user
  • Unique constraint violations: extract the constraint name from the inner SQL exception for targeted messaging
  • Foreign key violations: verify parent record existence before inserting child records in custom code
  • Timeout errors: increase the IDO Runtime command timeout for known long-running batch operations
  • Log all UpdateCollection failures with the full IDOCommands payload for post-mortem debugging

Netray AI agents generate production-ready UpdateCollection patterns with built-in error handling, concurrency management, and transaction safety. Eliminate data integrity issues in your SyteLine customizations.