InvokeIDO Method Examples for SyteLine Scripts
The InvokeIDO method is the primary mechanism for calling IDO methods from SyteLine form scripts, event handlers, and external integrations. It enables form scripts to execute server-side business logic, trigger workflows, and perform cross-IDO operations without direct database access. Mastering InvokeIDO patterns is essential for any SyteLine developer building interactive forms or process automation.
Basic InvokeIDO Syntax and Parameter Passing
In SyteLine form scripts, InvokeIDO is called through the ThisForm.PrimaryIDOCollection.InvokeIDO method or through the IDOClient helper. The method takes the IDO name, method name, and an ordered list of parameters. Parameters are passed as strings regardless of their underlying data type, and the IDO runtime handles type conversion on the server side. Return values come back as output parameters or through the method's return value, which you capture in a variable.
- Basic call: retVal = ThisForm.PrimaryIDOCollection.InvokeIDO("SLItems", "ItemExistsSp", item, ref exists)
- Use IDOClient for non-primary IDO calls: var client = new IDOClient(); client.Invoke("IDOName", "Method", params)
- Pass parameters by position, matching the order defined in the IDO method signature exactly
- Output parameters use the ref keyword in form scripts and return modified values after execution
- String encode all parameter values; the IDO runtime deserializes to the method's declared types
Real-World InvokeIDO Patterns
Common InvokeIDO use cases include validating data against external systems, triggering workflow processes, computing derived values, and calling stored procedures exposed through IDO methods. For example, calling the SLItems.CloneSp method duplicates an item master record with all its associated data. Calling SLCustomers.CustExistsSp validates a customer number before processing an order. Custom methods on your own IDOs can orchestrate multi-step business processes that would be too complex for form script logic alone.
- Item validation: InvokeIDO("SLItems", "CloneSp", sourceItem, newItem, ref resultMsg)
- Customer lookup: InvokeIDO("SLCustomers", "CustExistsSp", custNum, ref custExists)
- Job creation: InvokeIDO("SLJobs", "JobCreateSp", item, qty, dueDate, ref newJobNum)
- Custom workflow: InvokeIDO("Uf_ApprovalWorkflow", "SubmitForApproval", docId, approverGroup)
- Price calculation: InvokeIDO("SLCoPricing", "CalcPriceSp", custNum, item, qty, ref unitPrice)
Error Handling and Debugging InvokeIDO Calls
InvokeIDO calls can fail due to missing permissions, invalid parameter values, server-side exceptions, or network timeouts. Wrap every InvokeIDO call in a try-catch block and inspect the exception type and message. IDOMethodException indicates a business logic error thrown by the extension class. IDOException indicates a runtime or database error. For debugging, enable verbose logging on the IDO Runtime server and check the method name, parameter values, and return codes in the SyteLine application log.
- Wrap calls in try-catch: catch (IDOMethodException ex) for business errors, catch (Exception ex) for system errors
- Check ex.ErrorNumber for specific error codes defined in the extension class method
- Log parameter values before the call for debugging: helps reproduce issues in the development environment
- Use the IDO Request Tester to invoke methods interactively and verify parameter ordering
- Monitor the SLAppServer.log for method execution traces when verbose logging is enabled
Netray AI agents understand the complete SyteLine IDO method catalog. Generate correct InvokeIDO calls with proper parameters, error handling, and documentation in seconds.
Related Resources
SyteLine IDO Extension Methods Tutorial
Master SyteLine IDO extension methods. Learn to add custom business logic to standard and custom IDOs using C# extension classes in Infor CloudSuite Industrial.
Infor SyteLineSyteLine IDO Error Handling and Debugging
Debug SyteLine IDO errors effectively. Learn error categories, exception handling patterns, logging strategies, and diagnostic tools for Infor CloudSuite Industrial.
Infor SyteLineSyteLine Form Event Handlers Guide
Master SyteLine form event handlers including StdObjectLoaded, StdObjectSaved, and StdObjectDeleted. Build responsive forms in Infor CloudSuite Industrial.