B1 Actions
The B1 actions allow you to interact with SAP Business One Service Layer, enabling authentication and currency rate management directly through the robot.
b1.login
Logs in to SAP B1 via Service Layer and returns the active connection to be used in other actions.
Parameters:
- service_layer_url – Service Layer URL.
- company_db – Company database name.
- username – SAP B1 username.
- password – SAP B1 password.
- verify – (optional, default
True
) Whether to verify the SSL certificate.
Returns:
- b1_connection – Active connection object with SAP B1.
Usage Example
b1.set_currency_rate
Sets the exchange rate for a specific currency in SAP B1.
Parameters:
- b1_connection – Active connection obtained with
b1.login
. - currency – Currency code (e.g.,
"USD"
,"EUR"
). - rate – Exchange rate value (float greater than 0).
- rate_date – Rate date in format
YYYYMMDD
.
Returns:
- {} – Empty return on success.
Exceptions:
- SapB1InvalidRate – When rate is less or equal to zero.
- SapB1InvalidDate – When the date is invalid.
- SapB1InvalidCurrency – When the currency is invalid.
- SapB1ConnectionError – When communication with B1 fails.