The purpose of this repository is to provide a guide and reference for developing Infor Syteline Custom Assemblies/IDO Extension Classes. This includes both instructional markdown documents as well as C# utility classes that you can use while developing Custom Assemblies.
Find a quick reference guide for relevant Classes/Interfaces/Methods here
In order to access Mongoose/SyteLine code, we must import it. There are 8 DLLs that must be imported:
- IDOCore.dll
- IDOProtocol.dll
- IDORequestClient.dll
- MGScriptMgr.dll
- MGShared.dll
- MGSharedResources.dll
- WSEnums.dll
- WSFormServerProtocol.dll
These DLLs can be found on the utility server in:
<InstallerDirectory>/<DatedFolder>/Server/WinStudio/Create a new C# console app in the same solution. Import those same DLLs to the console app, if they are not there already. You will use this console app to test your assembly outside of the Syteline Frontend.
[IDOExtensionClass("CNH_DevelopmentTasks")]
public class CNH_DevelopmentTaskAssembly : IDOExtensionClass
{
}These methods contain the actual "work" that the Custom Assembly does. Since we make these static, we can access them without instantiating the whole Mongoose infrastructure.
/// <summary>
/// Returns a DataTable representing results for a Custom Load Method
/// </summary>
/// <param name="context">IIDOCommands to the Syteline Environment</param>
/// <returns>A DataTable of tasks</returns>
public static DataTable CNH_GetAllTasksProcess(IIDOCommands context) {
string columns = "CNH_TaskName, CNH_TaskDesc, CNH_Assignee";
DataTable returnData = new DataTable();
foreach( string col in columns.Split(','))
{
returnData.Columns.Add(col.Trim());
}
LoadCollectionRequestData request = new LoadCollectionRequestData()
{
IDOName = "CNH_DevelopmentTasks",
PropertyList = new PropertyList("CNH_TaskName, CNH_TaskDesc, CNH_Assignee"),
RecordCap = -1
};
LoadCollectionResponseData response = context.LoadCollection(request);
response.Fill(returnData);
return returnData;
}These are the methods that Syteline will call. Simply pass the base.Context to the static method as well as any parameters.
/// <summary>
/// SyteLine uses this method to hook into the class
/// </summary>
/// <returns>A result set of tasks</returns>
[IDOMethod(MethodFlags.CustomLoad, "Infobar")]
public DataTable CNH_GetAllTasks()
{
// even though we call it "context" elsewhere, it is actually Context.Commands
return CNH_GetAllTasksProcess(base.Context.Commands);
}By now, you have created a custom assembly, but you need to test it. Switch over to the Console App and structure it like so:
internal class Program
{
static void Main(string[] args)
{
string slserver = "http://your-server/IDORequestService/RequestService.aspx";
try
{
using (Client context = new Client(slserver, IDOProtocol.Http))
{
OpenSessionResponseData opnSesRes = context.OpenSession("username", "password", "siteconfig");
if (opnSesRes.Result.ToString() != "Success") { throw new Exception(opnSesRes.Result.ToString()); }
Console.WriteLine("Welcome to the Extension Class Testing Framework. Which method would you like to test?");
Type type = typeof(CNH_DevelopmentTaskAssembly);
TestingFrameworkMethods.PromptAndExecuteExtensionMethod(type, context);
}
} catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}Going over this code, the key pieces are:
// defines the server to attempt IDO Requests to
string slserver = "http{s}://{YourSytelineUtilityServer}/IDORequestService/RequestService.aspx"; // the try-catch around all work that might access data makes a last line of defense to catch and inform you of errors
// in particular, connection/configuration errors
try
{
// code here...
} catch (Exception ex)
{
Console.WriteLine(ex.Message);
} // By using a Using statment to control disposal of the Client
// We make sure that our session closes, even if we catch an exception, as long as the program completes on it's own.
using (Client context = new Client(slserver, IDOProtocol.Http))
{
// more code here ...
} // This line opens a session and fills opnSesRes with data about that process. Particularly "opnSesRes.Result" will have the connection response.
// If you use a workstation login, you will need to setup a password in syteline
// Note that only 1 programmatic IDO session per user can be open at one time
OpenSessionResponseData opnSesRes = context.OpenSession("{user@domain.com}", "{userpassword}", "{configuration/site name}"); // This line throws an exception (triggering the catch() block) if the connection was unsuccessful
if (opnSesRes.Result.ToString() != "Success") { throw new Exception(opnSesRes.Result.ToString()); } // These lines use the TestingFrameworkMethods.cs (found in this repo in code/)
// to render a user interface for selecting and executing methods in the class CNH_DevelopmentTaskAssembly
Type type = typeof(CNH_DevelopmentTaskAssembly);
TestingFrameworkMethods.PromptAndExecuteExtensionMethod(type, context);Building the project will generate a .dll and a symbols file that you will use when importing the CA into the Syteline System. The keyboard shortcut to build is, predictably, Ctrl+B
Use the "IDO Extension Class Assemblies" form to import the Assembly. You must include both the Symbols as well as the built .dll file (Assembly).
Only one IDO session can be open per-user, so it is important that the application closes the connection gracefully.
If it does not, you can use the Session Management form in SyteLine and close your session.




