📚 SAP Business One SDK Help

Company Object Members
See Also  Overview 

Public Methods

Public Method AddTrustedEntityAdds a trusted entity.
Public Method AuthenticateUserChecks whether a pair of username and password exist and match in the current SAP Business One company .

Note: this method is for superuser only.

Public Method ChangePasswordChanges the password of the actual user connected to SAP Business One. The system verifies whether the new password complies to the company password policy and if not, the system returns an error.
Public Method ConnectConnects to the SAP Business One company database.
Public Method DeleteTrustedEntityDeletes a trusted entity.
Public Method DisconnectDisconnects an active connection with the company database.
Public Method EndTransactionEnds a global transaction that started with the StartTransaction method.
Public Method GetBusinessObjectCreates a new business object.
Public Method GetBusinessObjectFromXMLCreates a new business object based on a valid XML file.
Public Method GetBusinessObjectXmlSchemaRetrieves the XML schema that is used by the object to validate the input XML files.
Public Method GetCompanyDateGet Company DATE
Public Method GetCompanyListRetrieves a list of the company databases located on the specified server.
Public Method GetCompanyServiceCreates a new CompanyService.
Public Method GetCompanyTimeGet Company Time
Public Method GetContextCookieCreates a cookie that consists of the current DI API session for Sign-on Procedure.
Public Method GetDBServerDatemethod GetDBServerDate
Public Method GetDBServerTimemethod GetDBServerTime
Public Method GetLastErrorRetrieves the error code and message for the last error for any object tied to the Company object.
Public Method GetLastErrorCodeRetrieves the last error code issued by any object related to the Company object.
Public Method GetLastErrorContextmethod GetLastErrorContext
Public Method GetLastErrorDescriptionRetrieves the description of the last error issued by any object related to the Company object.
Public Method GetNewObjectCodeRetrieves the key of the last added record.
Public Method GetNewObjectKeyRetrieves the key of the last added record.
Public Method GetNewObjectTypeGets the last added object type.
Public Method GetRegisteredServersListRetrieves a list of servers registered with the System Landscape Directory (SLD) server.

Use this method when creating a window for logging into SAP Business One. Create a dropdown list of servers and allow the user to select the server to which to connect.

Public Method GetTenantListmethod GetTenantList
Public Method GetTrustedEntitiesAllowedListmethod GetTrustedEntitiesAllowedList
Public Method GetXMLelementCountRetrieves the number of business objects described in an XML file.
Public Method GetXMLobjectTypeRetrieves the type of business object described in an XML file on a specific offset specified by the Index parameter.
Public Method IsDTCTransactionObjectSetChecks whether or not the DTCTransactionObject is set.
Public Method SetSboLoginContextDecodes the encrypted connection information received from the UI API -- based on the cookie created by the GetContextCookie method --  and then sets the connection information for log on to the Company database.

See Sign-on Procedure.

Public Method StartTransactionStarts a transaction, allowing you to perform data operations on several business objects.

Use the EndTransaction method to end the transaction and free locked records, allowing other users to access them.

Public Properties

Public Property AccessTokenWhen you enable Identity and Authentication Management as of SAP Business One 10.0 FP 2208, you can obtain an access token from the authorization server and use the access token to access some server resources.
Public Property AddonIdentifierSets or returns a string identifier that your add-on must use to connect to SAP Business One database.
Public Property ApplicationTo connect with SAP Business One, you can set this property to a SAPbouiCOM.Application object, and then call the Connect method without specifying any other connection properties -- the properties are taken from the UI API Application object.
Public Property AttachMentPathReturns the path to all the company's saved mail attachments and all contact related files.
Public Property BitMapPathReturns the path to all the picture files of the company, which are related to the Picture property of Items object, Picture property of BusinessPartners object, and documents.
Public Property CompanyDBSets or returns the name of the company SQL database .
Public Property CompanyIDIdentifies a unique company.
Public Property CompanyNameReturns the company name as defined in the database.
Public Property ConnectedReturns a Boolean value that specifies whether or not the Company object is connected to the database.
Public Property DbPasswordSets or returns the password for establishing a connection to the database server.

The field is not mandatory, as the database credentials are stored in the System Landscape Directory (SLD) server and you can use these values instead.

Public Property DbServerTypeThe database type.
Public Property DbUserNameSets or returns the user name for establishing a connection to the database server.

The field is not mandatory, as the database credentials are stored in the System Landscape Directory (SLD) server and you can use these values instead.

Public Property DTCTransactionObjectThis interface supports Distributed Transactions for MS-SQL database that are controlled by MS-DTC engine (Microsoft Distributed Transaction Coordinator).

DTC is a system service that coordinates transactions so that work can be committed as an atomic transaction even if it spans multiple resource managers on multiple computers, regardless of failures.

This interface is applicable for the following environment:

  • MS-SQL database server
  • C/C++ interface
  • ODBC connection type
  • DI API only (and not by DI Server)
Public Property ExcelDocsPathReturns the path to the Microsoft Excel documents exported from the SAP Business One application.
Public Property InTransactionReturns a Boolean value that specifies whether or not the transaction is active.
Public Property languageSets or returns the resource language of the object.
Public Property LicenseServerDeprecated in DI API 9.2 PL05.
Please use SLDServer instead.

The DI API will continue to support this property for backward compatibility.

The license server name and port for connecting to the company database. The value is in the format myServer:30000.

If no value is given, the default license server and port are used. If a server is given but no port is given, 30000 is used for the port.

Public Property MinimalSupportedVersionReturns the minimal version of the Company database that the Add-on supports.
Public Property PasswordSets or returns the SAP Business One password issued to the user.
Public Property SecurityCodeproperty SecurityCode
Public Property ServerSets or returns the SQL server to which the object connects.
Public Property SLDServerSet the System Landscape Directory (SLD) server address to connect to the company database and to retrieve the real license address from the SLD server.
Public Property UserNameSets or returns the user ID, which is used for log on to the SAP Business One application.
Public Property UserSignatureReturns the identification key of the active user who operates the system.
Public Property UserTablesReturns the UserTables object, which is the interface to the tables defined by the user. This object allows you to access to the user tables as if they were regular business objects.
Public Property UseTrustedSets or returns a Boolean value that specifies whether the Company object uses NT authentication, or the internal SQL Server user ObsCommon, to establish a connection with the SQL Server.
Public Property VersionReturns the version of the Company database.
Public Property WordDocsPathReturns the path to the Microsoft Word documents exported from the SAP Business One application. This directory also contains Microsoft Word templates, which are used for exporting data to Word documents.
Public Property XMLAsStringSets or returns a Boolean value that determines whether the XML data will be saved as a file or transferred as a string.
Public Property XmlExportTypeSets or returns a valid value of BoXmlExportTypes that specifies the types for exporting data from the database to XML format.
Public Property XmlFilteredTo improve security, you can set the property to true and call the AddTrustedEntity, DeleteTrustedEntity, and GetTrustedEntitiesAllowedList to prevent XML injection.

Events

Public Event ProgressIndicatorProgress indicator for long process execution.
To be supported in future releases.

See Also