Skip to main content
Version: 2.0
info

You are currently viewing documentation for CompuTec ProcessForce 2.0, which is still supported.

We recommend upgrading to CompuTec ProcessForce 3.0, which is a plugin installed and managed through CompuTec AppEngine 3.0, built on .NET 8.

However, please note that CompuTec AppEngine 3.0 has a different architecture, and all CompuTec components, including the CompuTec ProcessForce 3.0 plugin, need to be updated together to ensure full compatibility.

Before starting your installation or upgrade process, we strongly recommend reviewing the CompuTec AppEngine 3.0 and CompuTec ProcessForce 3.0 documentation.

Example 1: Connecting to Database

To establish a connection to the database using CompuTec ProcessForce API, follow these steps:

  • Add references to Computec.ProcessForce.API.dll and SAPbobsCOM.dll.
  • After installing CompuTec ProcessForce on your computer, you can locate CompuTec.ProcessForce.API.dll. reference within the .NET references folder.
  • The base object in the API is IProcessForceCompany, found within CompuTec.ProcessForce.API namespace. This object facilitates the creation of SAP and CompuTec ProcessForce entities.
  • It must be created using ProcessForceCompanyInitializator.CreateCompany();
IProcessForceCompany company = ProcessForceCompanyInitializator.CreateCompany();
            try
            {
                //set connection constaint
                company.SQLServer = "PCNBPO02";
                company.UseTrusted = true;
                company.UserName = "manager";
                company.Password = "enigma";
                company.LicenseServer = "127.0.0.1";
                company.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008;
                company.Databasename = "PFDemo";
                company.Language = SAPbobsCOM.BoSuppLangs.ln_Polish; 
                //Connect to Company
                if (company.Connect() == 1) 
                    Console.WriteLine(string.Format("Connected to Company {0}", company.SapCompany.CompanyName)); 
                else
                    Console.WriteLine(string.Format("Not Connected To compmany Error:{0}", company.getLastErrorDescription()));
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("Exception was throw {0}", ex.Message ));
            }
            finally
            {

                Console.ReadKey();
                if(company.IsConnected)
                    company.Disconnect();
            }