SyteLine Custom Stored Procedure Generator for IDO Methods
This generator writes a SQL Server stored procedure that follows SyteLine conventions so it can be published as an IDO method on a custom IDO. You get the procedure, a test harness, a UDDT check and the publishing steps.
Fill in
Use a distinctive prefix so it can never collide with a base Infor procedure.
Confirm with block 1 query; use whichever quantity type your database defines for itemwhse quantities.
1. Confirm the user-defined data types exist
SELECT t.name AS uddt, TYPE_NAME(t.system_type_id) AS base_type, t.max_length, t.precision, t.scale FROM sys.types AS t WHERE t.is_user_defined = 1 AND t.name IN (N'ItemType', N'WhseType', N'QtyUnitType', N'InfobarType') ORDER BY t.name;
2. Stored procedure
CREATE PROCEDURE dbo.UETItemReorderCheckSp (
@Item ItemType
, @Whse WhseType
, @QtyShort QtyUnitType OUTPUT
, @Infobar InfobarType OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Severity INT = 0;
DECLARE @OnHand QtyUnitType;
DECLARE @Reorder QtyUnitType;
SET @QtyShort = 0;
SET @Infobar = NULL;
-- Site view (itemwhse, not itemwhse_mst): rows are limited to the session site.
-- When you test outside the application, set the site context first, as your version requires.
SELECT @OnHand = iw.qty_on_hand,
@Reorder = iw.qty_reorder
FROM itemwhse AS iw
WHERE iw.item = @Item
AND iw.whse = @Whse;
IF @@ROWCOUNT = 0
BEGIN
SET @Infobar = N'No warehouse record for item and warehouse: ' + ISNULL(@Item, N'') + N' / ' + ISNULL(@Whse, N'');
SET @Severity = 16;
RETURN @Severity;
END
IF ISNULL(@OnHand, 0) < ISNULL(@Reorder, 0)
SET @QtyShort = ISNULL(@Reorder, 0) - ISNULL(@OnHand, 0);
RETURN @Severity;
END
GO3. Test harness
DECLARE @rc INT;
DECLARE @QtyShort QtyUnitType;
DECLARE @Infobar InfobarType;
-- Set the site context for this connection first, as your SyteLine version requires.
EXEC @rc = dbo.UETItemReorderCheckSp
@Item = N'PN-48213',
@Whse = N'MAIN',
@QtyShort = @QtyShort OUTPUT,
@Infobar = @Infobar OUTPUT;
SELECT @rc AS return_code, @QtyShort AS qty_short, @Infobar AS infobar;
-- Expect return_code 0 and a qty_short for a real item/warehouse,
-- and return_code 16 with a message for a pair that does not exist.4. Publish it as an IDO method
-- 1. On the IDOs form, open (or create) the custom IDO UETItemChecks and check it out. -- 2. Add a method named UETItemReorderCheckSp with method type Stored Procedure. -- 3. Load or enter the parameters in procedure order: Item, Whse, QtyShort, Infobar. -- Mark QtyShort and Infobar as output parameters. -- 4. Check the IDO in and refresh the IDO metadata cache the way your version requires. -- 5. Call it from a form event handler (method call), a form script, or REST: -- POST .../ido/invoke/UETItemChecks?method=UETItemReorderCheckSp with the parameters in the same order. -- 6. Grant the user groups that need it execute rights on the IDO method.
Verify for your version: the UDDT names (block 1), the itemwhse column names qty_on_hand and qty_reorder, and how your release sets site context for a raw SQL session. Return 0 for success and a non-zero severity with a message in @Infobar for errors, which is how the application shows the error to the user.
Have your custom method checked
Send the generated procedure and your SyteLine version; we will check UDDTs, site context and the IDO method definition.
Optional. The tool and every export work without this. No spam.
How to use it
Name the procedure with a distinctive prefix and the Sp suffix, then confirm the user-defined data types with block 1 before you create anything. SyteLine defines parameter types such as ItemType, WhseType and InfobarType so lengths match the application; using them keeps your method consistent with base procedures. Create the procedure in a test database, run block 3 with a known item and warehouse, then follow block 4 to publish it. The defaults implement a reorder check: how far the warehouse quantity on hand is below its reorder point.
- Read through site views (no _mst suffix) so rows follow the session site.
- Keep parameter order identical between the procedure and the IDO method.
- Never write to base tables directly from a custom method without validation.
The @Infobar and severity convention
Base SyteLine procedures return an integer severity and pass any message back through an @Infobar output parameter. Zero means success; a non-zero value tells the calling form or IDO that the call failed, and the text in @Infobar is what the user sees. Following the same convention means a form event handler or a REST invoke call can treat your method like a base method: check the return value, show the message, stop. Using 16 for an error is a common choice that mirrors SQL Server error severity; what matters to callers is zero versus non-zero.
Worked example
Item PN-48213 in warehouse MAIN has qty_on_hand 40 and qty_reorder 100. The test harness returns return_code 0 and qty_short 60. For item PN-99999, which has no itemwhse row in MAIN, it returns return_code 16, qty_short 0 and infobar No warehouse record for item and warehouse: PN-99999 / MAIN. Published on UETItemChecks, a planner's form can call the method from a button and display the shortage, and an integration can call the same method through IDO invoke.
Gotchas
Running the test in SSMS without a site context can return no rows from site views even when data exists, which looks like a bug in your procedure. Changing parameter order after publishing breaks every caller silently, because IDO invoke passes parameters by position. Custom procedures are yours to maintain: keep them in source control with a deployment script, and re-test after each Infor update in case a base table or UDDT changes. For logic that must run in the cloud, an IDO extension class is the long-term home.
Frequently Asked Questions
What is an IDO method in SyteLine?
An IDO method is an operation published on an IDO that forms, scripts and integrations can call. It can be backed by a stored procedure or by code in an extension class. Callers pass parameters by position, and output parameters come back to the caller, which is why the stored procedure signature must match the method definition.
Why use UDDTs instead of NVARCHAR?
SyteLine UDDTs such as ItemType carry the lengths the application expects. If Infor changes a length in a later release, objects declared with the UDDT follow it, while hard-coded NVARCHAR lengths can truncate values. Check the types exist with the sys.types query before you create the procedure.
Should I use the site view or the _mst table?
Inside methods called from the application, read site views such as itemwhse so rows follow the session site. Use _mst tables with an explicit site_ref filter only for cross-site reporting. Mixing them is a common cause of duplicate rows in multi-site databases.
How do custom parameters show up in Mongoose?
When you add the method to the IDO you define its parameters in procedure order and mark which are output. Form event handlers then pass properties or variables to them, and REST invoke calls pass them as a JSON array. Output parameter values are returned after the call completes.
If you want planners to ask questions like this of SyteLine in plain English on your own servers, we can expose methods like this one to a private, read-only assistant.
Related Tools
SyteLine EXTGEN Stored Procedure Generator
Create a documented extgen_ override for a base SyteLine procedure and audit existing overrides against their base procedures after each update.
Developer ToolsSyteLine Form Script Generator
Fill in the form, IDO, properties and target variable to get a VB form script method for SyteLine 9/10 that loads related data and shows it on the form.
Developer ToolsSyteLine IDO SOAP Web Service Client Generator
Generate a working C# console client and a PowerShell equivalent for the Mongoose IDO SOAP web service on on-premises SyteLine.
Developer ToolsSyteLine IDO REST Request Generator
Fill in host, configuration, IDO, properties and filter to get ready-to-use REST calls for loading, updating and invoking methods on SyteLine IDOs.
More Developer Tools tools
See all- SyteLine SQL Query Generator for Item, Job and Order Tables
- SyteLine SQL Blocking and Long Running Query Script Generator
- SyteLine Custom Table CREATE Script Generator
- SyteLine Mongoose Framework Events Reference
- SyteLine Event Action Types Reference
- SyteLine Event Action Parameter Functions Reference
- SyteLine WinStudio Standard Form Events Reference
- SyteLine Mongoose API Options Reference
- SyteLine SQL User-Defined Data Types Reference
Keep exploring
Free tools
- SyteLine IDO Custom Load Method GeneratorGet a working C# custom load method that returns a DataTable of late customer order lines, the IDO metadata steps to expose it, and a REST call to test it.
- SyteLine EXTGEN Stored Procedure GeneratorCreate a documented extgen_ override for a base SyteLine procedure and audit existing overrides against their base procedures after each update.
- SyteLine IDO Extension Class Method GeneratorFill in the IDO, method and load details and get a complete C# extension class with a hand-coded method, a request-object variant and the deployment steps.
ERP fixes and how-tos
- How to Add a Custom Method to a SyteLine IDO in C#How to expose a new server-side operation on a SyteLine IDO: define the method on the IDO Collection, implement it in C#, and call it safely.
- How to Add Custom Business Logic to a SyteLine IDO with an Extension ClassAdd custom validation to a SyteLine IDO without touching generated code: extension class structure, BeforeAdd/AfterModify events, and deployment steps.
Guides
- SyteLine IDO Custom Property and Method CreationCreate custom IDO properties and methods in SyteLine. Property mapping, method signatures, stored procedures, and .NET method development guide.
- SyteLine Stored Procedures: The Hidden Engine and How to Map ItHow stored procedures run SyteLine under the hood, why call graphs make them risky to change, and how automated effect classification maps thousands of procedures safely.
- SyteLine Mongoose IDO Development GuideMaster SyteLine IDO development with Mongoose. IDO architecture, custom methods, stored procedures, and IDL best practices for CloudSuite Industrial.