SYSPRO Business Objects
Overview
This document details the SYSPRO business objects utilized by the MiniMrpOrderCreation dashboard, focusing on their methods, parameters, and integration patterns.
PORTOI - Purchase Order Take On
Purpose
Creates and maintains purchase orders in SYSPRO.
Methods
- Add: Create new purchase order
- Update: Modify existing order
- Delete: Remove order (if not receipted)
Key Parameters
- ActionType: A=Add, C=Change, D=Delete
- ValidateOnly: Y/N for validation mode
- IgnoreWarnings: Y/N to suppress warnings
- ApplyIfEntireDocumentValid: All or nothing posting
Response Handling
Success response includes:
- Purchase order number
- Lines added count
- Total order value
- Warning messages (if any)
Error response contains:
- Error code
- Error description
- Field causing error
- Suggested resolution
Integration Patterns
Session Management
public async Task<bool> ValidateSession()
{
if (!_session.IsValid)
{
await _session.Reconnect();
}
return _session.IsValid;
}
Error Parsing
public List<string> ParseErrors(XDocument response)
{
return response.Descendants("Error")
.Select(e => e.Value)
.ToList();
}
Transaction Logging
public void LogTransaction(string businessObject,
string input, string output)
{
_logger.LogInformation(
"BO: {BusinessObject}, Input: {Input}, Output: {Output}",
businessObject, input, output);
}
Best Practices
- Always check session validity
- Parse responses for both errors and warnings
- Implement retry logic for transient failures
- Log all transactions for audit purposes
- Handle partial success scenarios