WM-Synergy Business Objects SDK Information
WM-Synergy Business Objects
WM-Synergy Business Objects, SBO, is a comprehensive transaction library built on the both the .net standard and .net framework platforms. This library allows the developer to quickly read/write/update transactional data with the Visual ERP database.
- Ensures that all tables required for a data transaction are properly updated.
- Synergy supports this product, if you find a bug, we will fix it at no cost to you.
- The code base allows you as a developer to write your own SQL code as needed.
- The code allows for roll back of transactions if a record does not complete properly.
The SBO installer package comes with sample programs on how to use the SynergyBusinessObjects.dll library.
As Microsoft moves away from standard system libraries included with Windows, it becomes important to include in your developer project any and all libraries that are provided with this SDK kit.
With updates for support of Visual 11 the SynergyBusinessObjects.dll relies on Oracle.ManagedDataAccess.dll, even if you are a Microsoft SQL only facility. 
The following libraries may also be required, in a customer created project:
- Microsoft.Bcl.AsynInterfaces.dll
- Oracle.ManagedDataAccess.dll
- System.Buffers.dll
- System.formats.Asn1.dll
- System.IO.Pipelines.dll
- System.Memory.dll
- System.Numerics.Vectors.dll
- System.Runtime.CompilerServices.Unsafe.dll
- Sytem.Text.Encodings.Web.dll
- System.Text.Json.dll
- System.Threading.Tasks.Extensions.dll
- System.Value.Tuple.dll
Starting with Visual 11 support for single site, Visual ERP 7 and below, is no longer supported or provided with sbo objects.
We can provide a non-supported version SynergyBusinessObjects70.dll (available upon request).
Connection Test
- [TestClass]
- public class ConnectionTest
- {
- #region Private Methods
- /// <summary>
- /// <c>GetSBOAuthenticator</c> url as specified in the app.config.
- /// </summary>
- /// <returns></returns>
- private Uri GetSBOAuthenticator()
- {
- Uri Url = null;
- SBOServer.AuthenticationService Svc = new SBOServer.AuthenticationService();
- ConfigurationManager.AppSettings["SchemaPath"] = Environment.CurrentDirectory + "\\";
- string SBOServer = ConfigurationManager.AppSettings["SBOServer"].ToString();
- string SBOPort = ConfigurationManager.AppSettings["SBOPort"].ToString();
- Url = new Uri(string.Format("http://{0}:{1}/AuthenticationService.asmx", SBOServer, SBOPort));
- return Url;
- }
- /// <summary>
- /// <c>ConnectToDbase</c> using the values set in the App.config file.
- /// </summary>
- /// <returns>Database connection</returns>
- private Synergy.BusinessObjects.DatabaseConnection ConnectToDbase()
- {
- Uri Url = GetSBOAuthenticator();
- Synergy.BusinessObjects.DatabaseConnection DataBase = new Synergy.BusinessObjects.DatabaseConnection(Url);
- //Connection information
- string DBType = ConfigurationManager.AppSettings["DBType"].ToString();
- string DBServer = ConfigurationManager.AppSettings["DBServer"].ToString();
- string DBDatabase = ConfigurationManager.AppSettings["DBDatabase"].ToString();
- string DBUser = ConfigurationManager.AppSettings["DBUserId"].ToString();
- string DBPassword = ConfigurationManager.AppSettings["DBPassword"].ToString();
- DataBase.UserCredentials.UseBlind = true; //Default Value = true
- DataBase.UserCredentials.DatabaseType = (DBType == "SqlServer" ? Synergy.BusinessObjects.DatabaseEngineType.SqlServer : Synergy.BusinessObjects.DatabaseEngineType.Oracle);
- DataBase.UserCredentials.Server = DBServer; //Enter the Server (and instance name for SqlsErver)
- DataBase.UserCredentials.Database = DBDatabase;
- DataBase.UserCredentials.UserID = DBUser;
- DataBase.UserCredentials.Password = DBPassword;
- DataBase.Connect();
- return DataBase;
- }
- #endregion
- #region Unit Tests
- [TestMethod]
- public void AuthenticationTest()
- {
- Uri Url = null;
- SBOServer.AuthenticationService Svc = new SBOServer.AuthenticationService();
- try
- {
- Url = GetSBOAuthenticator();
- Svc.Url = Url.ToString();
- Svc.AuthenticateNode("Test");
- Svc.Dispose();
- Assert.AreEqual(1, 1); // Success
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- }
- [TestMethod]
- public void ConnectToDatabase()
- {
- try
- {
- //Create the Database Connection – define the Connection Manager Server
- Synergy.BusinessObjects.DatabaseConnection Database = ConnectToDbase();
- if (Database.Connected)
- {
- Assert.IsTrue(1 == 1, "Database Connection is a Success!");
- Database.CloseConnection();
- }
- else
- Assert.Fail("Check the app.config settings.");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- }
- #endregion
- }
Connect To Database
- /// <summary>
- /// <c>ConnectToDbase</c> using the values set in the App.config file.
- /// </summary>
- /// <returns>Database connection</returns>
- private Synergy.BusinessObjects.DatabaseConnection ConnectToDbase()
- {
- Uri Url = GetSBOAuthenticator();
- Synergy.BusinessObjects.DatabaseConnection DataBase = new Synergy.BusinessObjects.DatabaseConnection(Url);
- //Connection information
- string DBType = ConfigurationManager.AppSettings["DBType"].ToString();
- string DBServer = ConfigurationManager.AppSettings["DBServer"].ToString();
- string DBDatabase = ConfigurationManager.AppSettings["DBDatabase"].ToString();
- string DBUser = ConfigurationManager.AppSettings["DBUserId"].ToString();
- string DBPassword = ConfigurationManager.AppSettings["DBPassword"].ToString();
- DataBase.UserCredentials.UseBlind = true; //Default Value = true
- DataBase.UserCredentials.DatabaseType = (DBType == "SqlServer" ? Synergy.BusinessObjects.DatabaseEngineType.SqlServer : Synergy.BusinessObjects.DatabaseEngineType.Oracle);
- DataBase.UserCredentials.Server = DBServer; //Enter the Server (and instance name for SqlsErver)
- DataBase.UserCredentials.Database = DBDatabase;
- DataBase.UserCredentials.UserID = DBUser;
- DataBase.UserCredentials.Password = DBPassword;
- DataBase.Connect();
- return DataBase;
- }
Run your own SQL Query
- [TestMethod]
- public void TestSQLCommand()
- {
- Synergy.BusinessObjects.DatabaseConnection Database = null;
- try
- {
- Database = ConnectToDbase();
- if (Database.Connected)
- {
- IDbCommand SQLCmd = Database.CreateNewCommand;
- SQLCmd.CommandText = "SELECT COUNT(*) FROM PART";
- object CmdReturn = SQLCmd.ExecuteScalar(); // Oracle returns a decimal, sql an int
- if (CmdReturn != DBNull.Value)
- {
- int PartCnt = 0;
- int.TryParse(CmdReturn.ToString(), out PartCnt);
- Assert.IsTrue(PartCnt > 0, "Fail, Perhaps you have no parts in dbo.PART?");
- }
- else
- Assert.Fail("Perhaps you have no Parts.");
- }
- else
- Assert.Fail("Datbase Connection Failed, Check App.config");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (Database != null) Database.Transaction = null;
- }
- }
- [TestMethod]
- public void ReadSite()
- {
- Synergy.BusinessObjects.DatabaseConnection Database = null;
- try
- {
- Database = ConnectToDbase();
- if (Database.Connected)
- {
- Synergy.BusinessObjects.VE.SITE Site = new Synergy.BusinessObjects.VE.SITE(Database);
- Site.ID = "%";
- int Count = 0;
- foreach (Synergy.BusinessObjects.VE.SITE Rec in Site.LoadLike(Site))
- {
- Count += 1;
- }
- Assert.IsTrue(Count > 0, "Fail, did not find any Site records");
- }
- else
- Assert.Fail("Datbase Connection Failed, Check App.config");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (Database != null) Database.Transaction = null;
- }
- }
Read a Customer Record
In this sample the code will read all customer records. Including the ones that are no longer active.
- [TestMethod]
- public void ReadCustomer()
- {
- Synergy.BusinessObjects.DatabaseConnection Database = null;
- try
- {
- Database = ConnectToDbase();
- if (Database.Connected)
- {
- Synergy.BusinessObjects.VE.CUSTOMER Customer = new Synergy.BusinessObjects.VE.CUSTOMER(Database);
- Customer.ID = "%";
- int Count = 0;
- foreach (Synergy.BusinessObjects.VE.CUSTOMER Rec in Customer.LoadLike(Customer))
- {
- Count += 1;
- }
- Assert.IsTrue(Count > 0, "Fail! Could not find any Customer records.");
- }
- else
- Assert.Fail("Datbase Connection Failed, Check App.config");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (Database != null) Database.Transaction = null;
- }
- }
Read Application Global
- [TestMethod]
- public void ReadApplication_Global()
- {
- Synergy.BusinessObjects.DatabaseConnection Database = null;
- try
- {
- Database = ConnectToDbase();
- if (Database.Connected)
- {
- APPLICATION_GLOBAL AppGlobal = new APPLICATION_GLOBAL(Database);
- AppGlobal = AppGlobal.Load(1);
- Assert.IsTrue(!string.IsNullOrEmpty(AppGlobal.COMPANY_NAME), "Fail! Check app global for a company name");
- }
- else
- Assert.Fail("Datbase Connection Failed, Check App.config");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (Database != null) Database.Transaction = null;
- }
- }
Create a Customer Order
- [TestMethod]
- public void CreateCustomerOrder()
- {
- Synergy.BusinessObjects.DatabaseConnection Database = null;
- try
- {
- Database = ConnectToDbase();
- if (Database.Connected)
- {
- CUSTOMER_ORDER CustOrd = new CUSTOMER_ORDER(Database)
- {
- SITE_ID = "101AMC",
- CUSTOMER_ID = "C-00001",
- STATUS = "R" //release it so we can ship it below.
- };
- CustOrd.Save(); //Save it and you get the auto-generated ID
- Assert.IsTrue(!string.IsNullOrEmpty(CustOrd.ID), "Fail! Did not create an order for customer 'C-00001'");
- }
- else
- Assert.Fail("Datbase Connection Failed, Check App.config");
- }
- catch (Exception ex)
- {
- Assert.Fail(ex.Message);
- }
- finally
- {
- if (Database != null) Database.Transaction = null;
- }
- }
Create a Voucher
There is a sample program, StarterMultiSite, that includes, or may be similar to, the following code:

- PAYABLE Voucher = new PAYABLE(_Database);
- Voucher.SITE_ID = txtSiteId.Text;
- Voucher.INVOICE_ID = txtInvoiceId.Text;
- Voucher.VENDOR_ID = txtVendorId.Text;
- Voucher.INVOICE_DATE = dtInvoiceDate.Value;
- Voucher.TOTAL_AMOUNT = Convert.ToDecimal(txtTotalAmount.Text);
- // Voucher.POSTING_DATE = dtPostingDate.Value; // This should be set at time of posting
- PAYABLE_LINE Line = new PAYABLE_LINE(_Database);
- Line.PURC_ORDER_ID = txtPOrder.Text; ;
- Line.PURC_ORDER_LINE_NO = Convert.ToDecimal(txtLineNmbr.Text);
- Line.QTY = Convert.ToDecimal(txtLineQty.Text);
- Line.PO_UNIT_PRICE = Convert.ToDecimal(txtPOUnitPrice.Text);
- Line.AMOUNT = Convert.ToDecimal(txtPOUnitPrice.Text) * Line.QTY; // Calculate the total line amount
- Line.RECEIVER_ID = txtReceiverId.Text;
- Line.RECEIVER_LINE_NO = Convert.ToDecimal(txtReceiverLine.Text);
- // Line.GL_ACCOUNT_ID =
- Voucher.Lines.Add(Line);
- Voucher.Save();
- MessageBox.Show(this, "Voucher Created", "Create Voucher", MessageBoxButtons.OK);
Create Customer Order with a Work Order
There is a sample program, StarterMultiSite, that includes, or may be similar to, the following code:

- using (new HourGlass())
- {
- try
- {
- // Create a Customer Order
- CUSTOMER_ORDER co = new CUSTOMER_ORDER(_Database)
- {
- #if MultiSite
- SITE_ID = "MMC",
- #endif
- CUSTOMER_ID = "FINMAN",
- STATUS = "R" //release it so we can ship it below.
- };
- co.Save(); //Save it and you get the auto-generated ID
- txtCustOrderId.Text = co.ID;
- txtCustOrderToShip.Text = co.ID;
- //Create an Order Line
- CUST_ORDER_LINE col = new CUST_ORDER_LINE(co)
- {
- #if MultiSite
- SITE_ID = co.SITE_ID,
- #endif
- PART_ID = "PRODUCT_P",
- USER_ORDER_QTY = 3,
- SELLING_UM = "EA"
- };
- col.Save();
- CUSTOMER_ORDER co1 = co.Load(co.ID);
- int foo = co1.Lines.Count;
- CUSTOMER_ORDER coLoader = new CUSTOMER_ORDER(_Database) { ID = "0200%" };
- List<CUSTOMER_ORDER> CoList = co.LoadLike(coLoader);
- foreach (CUSTOMER_ORDER c in CoList)
- {
- int foo2 = c.Lines.Count;
- }
- //Create a Work Order with an operation and a material
- WORK_ORDER wo = new WORK_ORDER(_Database)
- {
- #if MultiSite
- SITE_ID = "MMC",
- #endif
- TYPE = "W",
- //wo.BASE_ID = "00_SS1"; //Don't set for auto number gen - NEXT_NUMBER_GEN table
- LOT_ID = "0",
- SPLIT_ID = "0",
- SUB_ID = "0",
- PART_ID = col.PART_ID
- };
- wo.DESIRED_QTY = wo.DESIRED_QTY;
- //wo.Save();
- //Create an operation on the WO
- OPERATION op = new OPERATION(wo)
- {
- #if MultiSite
- SITE_ID = wo.SITE_ID,
- #endif
- SEQUENCE_NO = 10,
- RESOURCE_ID = "DRILL"
- };
- //op.Save();
- wo.OPERATIONS.Add(op);
- //Add a material to the OPERATION
- REQUIREMENT req = new REQUIREMENT(op)
- {
- #if MultiSite
- SITE_ID = op.SITE_ID,
- #endif
- PART_ID = "1/4plate"
- };
- //req.Save();
- op.REQUIREMENTS.Add(req);
- wo.Save();
- txtWorkOrderId.Text = wo.BASE_ID;
- //
- //Connect the Demand fron the CO Line to the Supply from the WO
- //
- DEMAND_SUPPLY_LINK dsl = new DEMAND_SUPPLY_LINK(_Database)
- {
- SUPPLY_TYPE = "WO",
- #if MultiSite
- SUPPLY_SITE_ID = wo.SITE_ID,
- #endif
- SUPPLY_BASE_ID = wo.BASE_ID,
- SUPPLY_LOT_ID = wo.LOT_ID,
- SUPPLY_SPLIT_ID = wo.SPLIT_ID,
- SUPPLY_SUB_ID = wo.SUB_ID,
- DEMAND_TYPE = "CO",
- #if MultiSite
- DEMAND_SITE_ID = co.SITE_ID,
- #endif
- DEMAND_BASE_ID = co.ID,
- DEMAND_SEQ_NO = col.LINE_NO,
- ALLOCATED_QTY = wo.DESIRED_QTY
- };
- dsl.Save(); //Save and the link is made
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
Delete a Packlist with SBO
The following code snippet demonstrates how to delete a Shipper, (Pack list), from the Infor Visual ERP database.
- public bool Delete_Packlist(string packlist_id)
- {
- DatabaseConnection _Database;
- bool result = true;
- try
- {
- // Add DB connection specific code here.
- using (IDbConnection conn = _Database.Connection)
- {
- conn.Open();
- SHIPPER s = new SHIPPER(_Database).Load(packlist_id);
- s.Delete();
- s.Save();
- }
- }
- catch (Exception ex)
- {
- _Database.Transaction?.Rollback();
- result = false;
- }
- finally
- {
- _Database.Transaction?.Dispose();
- _Database.Transaction = null;
- }
- return result;
- }
Related Articles
WM-Synergy SBO - Release Notes
v1100.1003 - 06/11/2025 Fix Issue in ShipperLine Customer Order for Part id 500pcs, WorkOrder to make part id is for 1000pcs. Linked CO to WO for Supply links for the 500 pcs. Ship the 500 pcs from sbo objects, expectations are (Visual ERP) customer ...
Retrieving Customizable User Defined Field (CUDF) List Values with SBO
The UFD List data is stored in the USER_DEF_FIELDS table. It looks like this: You can retrieve it with a direct SQL query, but you need to know the UDF’s ID for the field in question. Here is an example: SELECT PROGRAM_ID, ID, DOCUMENT_ID, LINE_NO, ...
WM-Synergy Macro Editor
WM-Synergy Macro Editor This is rich client user interface, which allows for the maintenance of Synergy Created Macros that support the Infor Visual ERP Manufacturing, (VE), Visual Basic Scripts (VBScript) typically used in a VE Macro situation. Each ...
Synergy Tax Version info
To Find the version of Synergy Tax. Launch Visual Manufacturing Navigate to Sales > Customer Maintenance > Macros Menu >Tax Configuration The bottom of the Tax Configuration Screen will have the version number.
Synergy/Avalara Tax - Release Notes
v1100.1003 2025.05.11 Add more diagnostic to validate the shipping address sent mod to SRI Macros SRITAX/SRITAXC to better handle an empty Avalara return data packet Add <line1><line2><line3> to the request packet information for traceability in ...