How to Add a Custom Method to a SyteLine IDO in C#
How to add a custom IDO method in SyteLine using C#
Also searched as
- create custom ido method syteline
- syteline add method to ido collection
- csi custom business logic c# method
- syteline ido method invoke custom code
Short answer
Custom IDO methods let you expose new server-side business logic - beyond the standard Load, Update, and Delete - as a named, callable operation from the SyteLine client, a script, or an external integration. You declare the method and its parameters on the IDO Collection, then implement it in an extension class that handles invoke calls for that method name.
Applies to: SyteLine 8.x, 9.x, CloudSuite Industrial (CSI) 10.x
Expose a new server-side method on an IDO
- 1Open IDO Collections and locate the IDO you want to extend; confirm it already has an Extension Assembly and Extension Class configured, or set one up pointing to your custom DLL and class.
- 2On the Methods tab of the IDO Collection, add a new method definition: give it a name, mark it as a custom method, and define its input and output parameters.
- 3In your C# extension class project, add a method whose name matches the one you defined, following the extension class's invoke pattern so the runtime routes calls for that method name into your code.
- 4Write the business logic using the IDO's own data access context so your method shares the same transaction and row locking as the rest of the call, instead of opening a separate ad hoc connection.
- 5Return a properly typed result matching the output parameters you defined, and raise IDO-style business errors rather than raw exceptions, so the client shows a normal error dialog instead of an unhandled exception.
- 6Compile, deploy the DLL and PDB to the extension bin folder, and recycle the app pool or restart the IDORuntime service so the new method definition and code are both picked up.
- 7Call the method from a test script - a direct Invoke against the IDO - before wiring it into a form, button, or external integration, so parameter and error handling are confirmed independently of the UI.
When a custom method is the right tool
Row-level hooks like BeforeUpdate or AfterInsert fire automatically on every standard operation against an IDO's rows, which makes them a natural fit for validation and defaulting. A custom method is different: it is an explicit, named operation the caller opts into, which suits work that is not a simple side effect of a normal save - a multi-step calculation, a call out to an external service, or a batch operation across several tables performed in one server round trip.
Choosing the wrong one usually shows up as awkward code: cramming a multi-table batch operation into a row hook, or building a custom method just to run one piece of field validation that a hook would have handled automatically.
Parameters and typing
The Methods tab lets you define input and output parameters with specific types - string, integer, decimal, datetime, and IDO-specific structured types. These declared types have to match what your C# method actually accepts and returns; a mismatch is one of the most common causes of a method that fails to invoke with a generic, unhelpful error rather than a clear type message.
Keep the parameter list as narrow as the operation actually needs. A method with a handful of well-typed parameters is far easier to call correctly from a script, a form, or an external integration than one that takes a large, loosely typed structure.
Transactions and shared context
Use the IDO's session and transaction context inside your method rather than opening a separate SqlConnection. That way your method's writes commit or roll back together with everything else happening in that same call, and are visible to other logic - row hooks, App Events - running as part of the same operation.
A method that opens its own connection can commit independently of the surrounding call, which breaks atomicity and can also deadlock against rows the outer IDO transaction is already holding.
Calling the method after it's built
Once defined, a custom method is callable the same way as any built-in IDO method: from a business rule, an App Event action, a custom form's script, a SOAP IDO web-service Invoke call, or, in CSI cloud, an ION API-based integration. That makes it a reusable building block rather than something tied to a single screen, which is worth designing for from the start.
Common pitfalls
- !Defining the method on the IDO Collection but never redeploying the extension assembly, or vice versa - both sides must match.
- !Mismatched parameter types between the Methods tab definition and the actual C# signature, which usually surfaces as a generic invoke error.
- !Opening a separate database connection inside the method instead of using the IDO's transaction context, breaking atomicity with the rest of the call.
- !Throwing a raw .NET exception instead of an IDO-style business error, which the SyteLine client shows as an unhandled-exception dialog.
- !Not testing the method independently with a direct Invoke call before wiring it into a form, so UI issues and method issues get confused.
- !Forgetting that custom methods, like extension classes, must be re-verified after an Infor CSI upgrade or patch.
How an ERP-grounded AI assistant handles this
SyteRay can scaffold the boilerplate for a new custom IDO method - the Methods tab parameter definitions plus a matching C# stub with the correct invoke signature - from a plain description of what the method should do, so a developer's first pass is business logic rather than reverse-engineering the invoke pattern from an existing example. It can also flag, before deployment, any parameter type mismatch between the IDO Collection definition and the C# method signature.
Frequently asked questions
What is the difference between a custom IDO method and a hook like BeforeUpdate?
A hook like BeforeUpdate fires automatically on every standard operation against that IDO's rows. A custom method is a separate, explicitly named operation you define and call on purpose - closer to adding a new function to an API than intercepting an existing one.
Can a custom IDO method call other IDOs?
Yes. Inside the extension class you can access other IDOs through the same server-side session, letting one custom method coordinate logic across multiple business objects in a single transaction instead of requiring several separate round trips from the client.
Why does my new method not show up when I try to invoke it?
Usually the IDO Collection metadata cache has not refreshed, or the app pool or IDORuntime service has not restarted since you deployed the new assembly. Recycle the pool or restart the service, and confirm the method is saved and marked active on the Methods tab.
Can I call a custom IDO method from outside SyteLine?
Yes - once defined, it is callable through the same SOAP IDO web service used for other IDO operations, or through ION API integrations in CSI cloud, the same way built-in methods like Load and Update are called.
Related
How to Add Custom Business Logic to a SyteLine IDO with an Extension Class
SyteLine lets you add validation, defaulting, and side-effect logic to any IDO without touching Infor's generated code, by writing an IDO extension class in C# and hooking into the object's Before/After events. The extension assembly is compiled, deployed next to the IDO Runtime, and picked up once the runtime cache is refreshed.
AdvancedHow to Debug a SyteLine IDO Extension Class in Visual Studio
SyteLine IDO extension classes run inside the server-side IDO runtime, not inside Visual Studio, so breakpoints only hit once you attach the debugger to that process and deploy matching PDB files. Attach to IDORuntime.exe on classic installs or to the w3wp.exe worker process on IIS-hosted CSI, build in Debug configuration, and copy the DLL and PDB together before setting breakpoints.
AdvancedHow to Call SyteLine IDOs from an External Application
SyteLine exposes its IDO layer as a SOAP web service, commonly published through an IDORequestHandler endpoint, so an external .NET application, middleware platform, or script can Load, Update, Delete, and Invoke methods on the same IDOs the SyteLine client itself uses. You call it like any SOAP service: reference the WSDL, authenticate, and pass the IDO name, method, and parameters in the request.
AdvancedHow the SyteLine Event System Works for Workflow Notifications
SyteLine's Event Manager lets administrators subscribe to IDO-level events, such as a purchase order being released or a customer credit hold being set, and fire an email, a Mongoose script, or a workflow action without writing an IDO extension. Cloud tenants can extend the same triggers into ION Workflow for multi-step, cross-application approval processes.
Error fixFixing SyteLine's 'Object reference not set to an instance of an object' error
This is a generic .NET NullReferenceException surfacing through the SyteLine IDO Runtime, not a SyteLine-specific error code. It almost always means a form, script or IDO method referenced a field, row or object that came back null, usually after a customization, a missing related record, or a view/IDO method call before the form finished loading. Turn on detailed client logging and check the most recent customization or form event first.
Error fixDiagnosing and fixing SyteLine session timeout errors
SyteLine session timeouts come from one of three independent layers: the IDO Data Service session timeout on the app server, the IIS/application pool idle timeout for the web (Mongoose Web) client, or a load balancer/proxy idle timeout in front of a CloudSuite hosted environment. Fixing the wrong layer is the most common mistake - you need to identify which layer is actually expiring the session before changing anything.
AI for ERPAI for Infor SyteLine and CloudSuite Industrial
Add grounded AI to Infor SyteLine or CloudSuite Industrial: natural-language answers, agents over IDOs and ION, on-prem or CloudSuite deployment.
AI for ERPAI Agents Over Infor ION API, BODs, and the Infor Data Lake
Build AI agents on Infor ION API Gateway, BODs, and Data Lake, alongside or instead of Infor's own GenAI features, with your choice of model and hosting.
Stuck on Infor SyteLine (CloudSuite Industrial)?
Talk to engineers who work inside Infor SyteLine (CloudSuite Industrial) every week, and who build private AI that answers these questions from your own ERP data.