Developer ToolsFree generatorPDF, Excel, Word exportInfor SyteLineAll Infor SyteLine (CloudSuite Industrial) tools

SyteLine IDO Extension Class Method Generator (C#)

This generator writes a complete C# IDO extension class for SyteLine 9, CSI 10 and other Mongoose-based releases on-prem, with one hand-coded method that loads rows through another IDO and returns a message in Infobar. It also gives the request-object form of the load and the steps to deploy the assembly.

Fill in

Generated code
Download:

1. Extension class with a hand-coded method

using System;
using Mongoose.IDO;
using Mongoose.IDO.Protocol;

namespace Netray.SyteLine.Ext
{
    [IDOExtensionClass("SLItems")]
    public class UETItemsExt : IDOExtensionClass
    {
        // Hand-coded method. Returns 0 on success, non-zero on error.
        // The message for the caller goes in Infobar.
        [IDOMethod(MethodFlags.None, "Infobar")]
        public int GetItemOnHandSummary(string Item, ref string Infobar)
        {
            try
            {
                // Escape single quotes so the value cannot break out of the filter.
                string safeValue = (Item ?? string.Empty).Replace("'", "''");
                string filter = string.Format("Item = N'{0}'", safeValue);

                LoadCollectionResponseData response = this.Context.Commands.LoadCollection(
                    "SLItemWhses",
                    "Item, Whse, QtyOnHand",
                    filter,
                    "Whse",
                    0);

                int sumIndex = response.PropertyList.IndexOf("QtyOnHand");
                decimal total = 0m;
                int rows = 0;

                foreach (IDOItem item in response.Items)
                {
                    if (!item.PropertyValues[sumIndex].IsNull)
                    {
                        total += item.PropertyValues[sumIndex].GetValue<decimal>();
                    }
                    rows++;
                }

                Infobar = string.Format("{0} rows from SLItemWhses, total QtyOnHand {1}", rows, total);
                return 0;
            }
            catch (Exception ex)
            {
                Infobar = ex.Message;
                return 16;
            }
        }
    }
}

2. Same load using LoadCollectionRequestData

// Same load written with LoadCollectionRequestData, useful when you
// build the property list or filter step by step.
LoadCollectionRequestData request = new LoadCollectionRequestData();
request.IDOName = "SLItemWhses";
request.PropertyList.SetProperties("Item, Whse, QtyOnHand");
request.Filter = filter;
request.OrderBy = "Whse";
request.RecordCap = 0;

LoadCollectionResponseData response = this.Context.Commands.LoadCollection(request);

// Read a value by row and property name instead of by index:
// decimal first = response[0, "QtyOnHand"].GetValue<decimal>();

3. Deployment steps

// Deployment checklist for UETItemsExt on SLItems
// 1. Create a .NET Framework class library project and reference the Mongoose
//    framework assemblies from your SyteLine server install (the assemblies that
//    contain the Mongoose.IDO and Mongoose.IDO.Protocol namespaces). Target the
//    same .NET Framework version as the installed framework.
// 2. Build in Release and keep the DLL name stable, for example Netray.SyteLine.Ext.dll.
// 3. Import the DLL on the IDO Custom Assemblies form.
// 4. Open the SLItems IDO in IDO metadata (or your UET extension IDO), set
//    Custom Assembly Name to the imported assembly and Ext Class Name to
//    Netray.SyteLine.Ext.UETItemsExt.
// 5. Add method GetItemOnHandSummary as a hand-coded method with parameters
//    Item (input) and Infobar (input/output, message).
// 6. Unload or refresh IDO metadata on the application server, then test the
//    method from a form event or the IDO method call in a test configuration.

Patterns follow the Mongoose IDO Development Guide (IDOExtensionClass attribute, IDOMethod with MethodFlags.None and the Infobar message parameter, LoadCollection on this.Context.Commands). Verify for your release: the base class name (the guide's declaration sample inherits IDOExtensionClass; newer guides also describe Mongoose.IDO.ExtensionClass), the exact framework DLLs to reference and their .NET Framework version, the meaning of a record cap of 0 versus -1, and the property names on the IDO you load. Test in a non-production configuration.

Get your extension class reviewed

Send us your extension class and IDO metadata and we will review method signatures, filters and deployment steps against your SyteLine release.

Optional. The tool and every export work without this. No spam.

Was this tool useful?

How to use it

Enter the namespace and class name for your assembly, the IDO the method will live on, and the method and parameter names. Then describe the load: which IDO to read, the properties, a filter template where {0} is replaced by the escaped parameter value, the sort and the record cap. Pick a numeric property to total so the sample produces a useful Infobar message. Copy block 1 into a class library project, build, and follow block 3 to import and wire it up. Block 2 shows the same call with LoadCollectionRequestData, handy when you add properties or filters conditionally.

What the code does

The IDOExtensionClass attribute ties the class to the IDO and the IDOMethod attribute marks a standard method with Infobar as its message parameter. A standard hand-coded method returns an int: 0 for success and non-zero for failure, with the reason in the ref string Infobar. Inside, this.Context.Commands.LoadCollection runs a load through the IDO layer, so the target IDO's own events and rules apply instead of raw SQL. The response holds a PropertyList and an Items collection; the code finds the column index once, then reads each value with GetValue<decimal>() after checking IsNull.

  • Return 0 on success, non-zero on error
  • Infobar carries the message back to the form
  • Load through IDOs, not direct SQL, to keep business rules

Worked example

With the defaults, the method GetItemOnHandSummary on SLItems takes Item = 'BRK-1001', loads SLItemWhses filtered to Item = N'BRK-1001' sorted by Whse, totals QtyOnHand across warehouses and returns 0 with Infobar set to something like 3 rows from SLItemWhses, total QtyOnHand 412.00000000. A form can call it from an event handler with the Call Method response and show Infobar to the user. Change the load IDO and properties to reuse the pattern for open orders, job status or vendor history.

Gotchas

Do not rely on instance or static fields to keep state between method calls; the framework controls when extension class instances are created, so pass everything the method needs as parameters or read it again. Always escape values you place in a filter, as the template does, or a quote in the input breaks the filter and opens the door to injection. Property names must be IDO property names, not column names. A record cap that is too high on a big IDO loads the application server, so filter tightly. After importing a new build, metadata may be cached; refresh it before deciding your change did not work. Keep custom assemblies and IDOs prefixed so upgrades do not overwrite them.

Frequently Asked Questions

What is an IDO extension class in SyteLine?

It is a .NET class compiled into a class library, imported into the IDO metadata and attached to an IDO. Its methods appear as hand-coded methods or custom load methods on that IDO, so forms, event handlers and REST calls can use custom logic through the same IDO layer as standard functions.

Where is the Mongoose IDO Development Guide?

Infor publishes the Mongoose IDO Development Guide on docs.infor.com under the Mongoose documentation. It covers extension classes, IDOMethod parameters, LoadCollection, UpdateCollection and Invoke, events and debugging. Check the version that matches your framework release, as details such as base classes are described differently over time.

Should I use an IDO method or a stored procedure?

Use a stored procedure when the logic is set-based and close to the data, and call it through an IDO method. Use a C# extension class when you need to call other IDOs, external services or .NET libraries. Both report errors the same way, with a non-zero return and an Infobar message.

How do I debug a SyteLine IDO extension class?

Log messages and watch them in LogMonitor, or attach a debugger to the IDO runtime process on a development server with the assembly built in Debug. The IDO Development Guide also describes testing assemblies locally. Never attach a debugger to a production application server.

If you want an AI assistant that drafts and reviews SyteLine extension classes against your own IDO metadata on your own servers, we can set that up for your developers.

ArchRay builder
Design the on-prem AI stack for Infor SyteLine: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring

Free tools

ERP fixes and how-tos

Guides