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

SyteLine IDO Custom Load Method (CLM) Generator

This generator writes a custom load method (CLM) in C# for a SyteLine 9 or CSI 10 IDO extension class. It returns a DataTable of late customer order lines built from SLCoitems, with the IDO metadata steps and a REST call that tests it.

Fill in

Generated code
Download:

1. Custom load method (C#)

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

namespace Netray.SyteLine.Ext
{
    [IDOExtensionClass("UETOpenOrderLines")]
    public class UETOpenOrderLinesExt : IDOExtensionClass
    {
        // Custom load method: returns a DataTable whose column names must match
        // the property names defined on the UETOpenOrderLines IDO.
        [IDOMethod(MethodFlags.CustomLoad)]
        public DataTable GetLateLinesClm(string Whse, int DaysLate)
        {
            DataTable dt = new DataTable("Results");
            dt.Columns.Add("CoNum", typeof(string));
            dt.Columns.Add("CoLine", typeof(short));
            dt.Columns.Add("CoRelease", typeof(short));
            dt.Columns.Add("Item", typeof(string));
            dt.Columns.Add("DueDate", typeof(DateTime));
            dt.Columns.Add("QtyOpen", typeof(decimal));

            DateTime cutoff = DateTime.Today.AddDays(-DaysLate);
            string safeWhse = (Whse ?? string.Empty).Replace("'", "''");
            string filter = string.Format("Whse = N'{0}' AND Stat = N'O'", safeWhse);

            LoadCollectionResponseData response = this.Context.Commands.LoadCollection(
                "SLCoitems",
                "CoNum, CoLine, CoRelease, Item, DueDate, QtyOrdered, QtyShipped",
                filter,
                "DueDate",
                0);

            int iCoNum = response.PropertyList.IndexOf("CoNum");
            int iCoLine = response.PropertyList.IndexOf("CoLine");
            int iCoRelease = response.PropertyList.IndexOf("CoRelease");
            int iItem = response.PropertyList.IndexOf("Item");
            int iDue = response.PropertyList.IndexOf("DueDate");
            int iOrdered = response.PropertyList.IndexOf("QtyOrdered");
            int iShipped = response.PropertyList.IndexOf("QtyShipped");

            foreach (IDOItem row in response.Items)
            {
                if (row.PropertyValues[iDue].IsNull)
                {
                    continue;
                }
                DateTime due = row.PropertyValues[iDue].GetValue<DateTime>();
                if (due >= cutoff)
                {
                    continue;
                }
                decimal qtyOpen = row.PropertyValues[iOrdered].GetValue<decimal>()
                    - row.PropertyValues[iShipped].GetValue<decimal>();
                if (qtyOpen <= 0m)
                {
                    continue;
                }
                dt.Rows.Add(
                    row.PropertyValues[iCoNum].GetValue<string>(),
                    row.PropertyValues[iCoLine].GetValue<short>(),
                    row.PropertyValues[iCoRelease].GetValue<short>(),
                    row.PropertyValues[iItem].GetValue<string>(),
                    due,
                    qtyOpen);
            }

            return dt;
        }
    }
}

2. IDO metadata checklist

// IDO metadata checklist for UETOpenOrderLines.GetLateLinesClm
// 1. Import the assembly on the IDO Custom Assemblies form and set the IDO's
//    Custom Assembly Name and Ext Class Name (Netray.SyteLine.Ext.UETOpenOrderLinesExt).
// 2. Add method GetLateLinesClm with method type Custom Load and parameters
//    Whse (string) and DaysLate (int), in that order.
// 3. Define IDO properties CoNum, CoLine, CoRelease, Item, DueDate, QtyOpen.
//    Names must match the DataTable column names exactly, including case.
// 4. Make them unbound (not bound to a table column) with data types and
//    lengths that match the values returned.
// 5. Refresh IDO metadata on the application server, then test with the
//    REST call below or from a form whose collection uses the custom load.

3. REST test call

GET https://sl-app01/IDORequestService/ido/load/UETOpenOrderLines?properties=CoNum,CoLine,CoRelease,Item,DueDate,QtyOpen&clm=GetLateLinesClm&clmparam=MAIN,5
Authorization: <token from the token request>
X-Infor-MongooseConfig: SL_PROD
Accept: application/json

# clmparam lists the method parameters in declaration order, comma separated.
# URL encode values that contain spaces or commas.

Based on the Mongoose IDO Development Guide: custom load methods return an IDataReader or a DataTable, and IDOMethod takes MethodFlags.CustomLoad. Verify for your release: the base class name (IDOExtensionClass in the guide's declaration sample), the SLCoitems property names and the Stat value for open lines, the REST v2 URL shape and headers your IDO request service expects, and whether a record cap of 0 means the default cap. The CLM output columns are fixed in this template; edit the DataTable columns and the IDO properties together.

Get your CLM reviewed

Send us your custom load method and IDO metadata and we will check property mapping, filters and load size against your SyteLine release.

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

Was this tool useful?

How to use it

Choose the IDO that will expose the result, usually a custom UET IDO with only unbound properties, and the method name. Set the source IDO, an extra filter and a record cap for the load inside the method. The parameters are Whse and DaysLate, and the output columns are CoNum, CoLine, CoRelease, Item, DueDate and QtyOpen. Copy block 1 into your extension class project, then follow block 2 to add the method as a Custom Load method and define matching properties. Fill the base URL, configuration and test values to get block 3, a REST call you can paste into Postman.

How a custom load method works

A standard IDO load reads the table the IDO is bound to. A custom load method replaces that: the IDO calls your method, and whatever DataTable or IDataReader it returns becomes the collection a form, report or REST client sees. Each DataTable column is matched to an IDO property by name, so the names must match exactly. Parameters come from the caller; over REST they are passed in clmparam in the order the method declares them. Inside the method you can load other IDOs, call procedures or compute values, here open quantity as QtyOrdered minus QtyShipped and lateness against today minus DaysLate.

  • Flag: MethodFlags.CustomLoad
  • Return type: DataTable or IDataReader
  • Column names = IDO property names
  • REST: clm and clmparam on the load call

Worked example

With Whse MAIN and DaysLate 5, the method loads SLCoitems where Whse = N'MAIN' and Stat = N'O', sorted by due date. A line due 12 days ago with 100 ordered and 40 shipped passes: due date is before today minus five days and QtyOpen is 60. A line due 2 days ago is skipped, and so is a fully shipped line. The REST call returns those rows as a collection with the six properties, ready for a dashboard, an ION workflow or a Mongoose form grid bound to UETOpenOrderLines.

Gotchas

A property defined on the IDO but missing from the DataTable comes back empty, and a column with a different name is ignored, so keep both lists in step. The filter inside the method controls how many rows the source load returns; a loose filter with a high cap reads the whole order book on every call. Dates and decimals must use the right .NET types, or conversion fails when the IDO maps values. Filtering and sorting requested by the caller do not automatically apply to a CLM; the guide's topic on including filters in custom load methods shows how to honour them. Escape every string parameter you put into a filter.

Frequently Asked Questions

What is an IDO in SyteLine?

An IDO, or Intelligent Data Object, is the Mongoose business object layer between forms and the SQL database. It defines properties, methods and events, applies security and runs business logic. Forms, reports, the Excel add-in and REST clients all load and update data through IDOs.

What is the difference between a custom load method and a hand-coded method?

A hand-coded method returns an integer status and passes values back through parameters such as Infobar. A custom load method returns rows, as a DataTable or IDataReader, which the IDO presents as its collection. Use a CLM when the caller needs a result set, such as a grid or a REST load.

How do I select records from an IDO in Mongoose code?

Call this.Context.Commands.LoadCollection with the IDO name, property list, filter, order by and record cap, or build a LoadCollectionRequestData object. Read the response by finding each property's index in PropertyList and calling GetValue on the item's PropertyValues, or by using the response indexer with row and property name.

How do I call a custom load method over REST?

Use the normal IDO load request for the IDO with the properties you want, plus clm set to the method name and clmparam set to the parameter values in order. Authenticate the same way as any other IDO request service call on your release.

If you want your team to ask SyteLine for late lines and shortages in plain English instead of building a CLM for each question, we can set up a private AI layer on your own servers.

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

Integrations