Coresuite Service allows running scheduled rules in a SAP Business One database independent of the SAP Business One client.
Coresuite Service is conceptually similar to Coresuite Customize and allows code written in C#. The difference between Coresuite Service and Coresuite Customize is mainly that Coresuite Service rules are executed based on a time schedule whereas Coresuite Customize rules are triggered by events in the SAP Business One user interface.
- SAP Business One 9.1
- SQL Server 2008, 2012 or 2014
- Coresuite 5.05 or higher
Coresuite Service is dependent on Coresuite being installed. This is because Coresuite Service uses the Coresuite framework.
Coresuite Service rules can use the SAP DI API to add, update and delete objects. The UI API cannot be used because the Coresuite Service process is external to the SAP Business One application. This also applies to the SwissAddonFramework which is accessible from Coresuite Service.
Coresuite Service is not available for HANA.
A license will need to be installed in Coresuite to be able to use Coresuite Service. This license does not need to be assigned to a specific user.
Before installing Coresuite Service any previous version must be uninstalled first. Please consult the Uninstallation chapter in the end for more information.
Run the installer, “CoresuiteServiceSetup.msi” and follow the steps in the Wizard. The default choices can be accepted.
Coresuite Service Setup creates a file, %ProgramData%\coresystems\Coresuite Service\ CoresuiteServiceConfig.xml. %ProgramData% is usually C:\ProgramData.
Open the file in a text editor and set the configuration values for your system.
Each database needs its own <config> section. If there is only one database using the service, remove the second <config> section. Add additional <config> sections for each database you want to use with Coresuite Service.
The value “systemnumber” is the System Number in SAP (Help > About SAP Business One).
Starting the service
In the Windows Services view, right click Coresuite Service and select “Start”.
Using Coresuite Service
Coresuite Service installs a shortcut to the Customize client on the desktop. This is called “Coresuite Customize”.
Click Add Row. The code editor/scheduler will open:
Configure the rule by writing code and setting up a schedule. Click “Save” to save the rule.
Coresuite Service creates a table in the coresuite database called COR_SVC_LOG. This is the default logging mechanism in Coresuite Service.
When the database is not available for whatever reason, the backup logging mechanism is by writing text files to %ProgramData%\coresystems\Coresuite Service\Debug Logs.
Please consult these to log locations first and provide the output when contacting support.
From release 5.05, Coresuite Service is distributed as a Microsoft Installer package (msi file). That makes it possible to uninstall the service from Add/Remove Programs in the Control Panel or by double clicking the msi file and selecting the “Remove” option.
Note: Before uninstalling the service, it must manually be stopped in the Windows Services view or command line: net stop coresuiteservice
To get a connection to the SAP Business One DI (SAPbobsCOM.Company), the following pattern is strongly recommended:
using (CoresuiteService.Common.API.SAPConnection sap = CoresuiteService.Common.API.SAPConnection.CreateConnection())
// Do stuff
The SAPConnection object contains a method, GetB1Connector() that returns a SwissAddonFramework.B1Connector. This gives access to the DI API.
Execute a Master Data Management rule
The following code can be used to trigger a Master Data Management rule:
Log a message to the debug table
// Log an info message
CoresuiteService.Common.API.DebugLog.Info("This is the message");
// Log an error message
CoresuiteService.Common.API.DebugLog.Error("This is the message ");