SYSPRO Posting Patterns
Overview
This document describes the patterns and best practices for posting transactions to SYSPRO through business objects, specifically focusing on purchase order creation through the PORTOI business object.
PORTOI Business Object
Purpose
Creates purchase orders in SYSPRO with full validation and business rule enforcement.
XML Structure
Input XML format:
<PostPurchaseOrders>
<Item>
<Supplier>SUP001</Supplier>
<Warehouse>WH01</Warehouse>
<OrderDate>2024-01-15</OrderDate>
<DueDate>2024-02-15</DueDate>
<StockLines>
<StockLine>
<StockCode>ITEM001</StockCode>
<OrderQty>100</OrderQty>
<Price>10.50</Price>
</StockLine>
</StockLines>
</Item>
</PostPurchaseOrders>
Parameter XML:
<PostPurchaseOrders>
<Parameters>
<ValidateOnly>N</ValidateOnly>
<IgnoreWarnings>N</IgnoreWarnings>
<ApplyIfEntireDocumentValid>Y</ApplyIfEntireDocumentValid>
</Parameters>
</PostPurchaseOrders>
Posting Workflow
Pre-Validation
- Validate supplier is active
- Check stock items exist
- Verify warehouse validity
- Confirm user permissions
Posting Process
- Generate XML documents
- Validate SYSPRO session
- Submit to business object
- Parse response for errors
- Extract generated order number
Error Handling
Common errors and handling:
- Supplier on hold: Notify user, skip order
- Stock not found: Log error, continue with valid items
- Insufficient privileges: Show permission error
- Locked records: Implement retry mechanism
Transaction Management
Batch Processing
- Group orders by supplier
- Use transaction boundaries
- Implement partial success handling
- Log all transactions for audit
Rollback Strategies
- Track posted orders for reversal
- Implement compensation transactions
- Maintain posting status tracking
Best Practices
- Always validate before posting
- Use structured error handling
- Log all XML for debugging
- Implement idempotency checks
- Handle partial success scenarios