Example
What you'll build
This integration retrieves sales opportunities from SAP Business One through the CRM connector. It logs the returned collection and handles connector errors.
Operations used:
- List Sales Opportunities : Retrieves the SalesOpportunities collection.
Architecture
Prerequisites
- An SAP Business One environment with Service Layer enabled.
- A company database and user credentials authorized to view sales opportunities.
- The SAP Business One Service Layer URL.
Setting up the SAP Business One CRM integration
New to WSO2 Integrator? Follow the Create a New Integration guide to set up your integration first, then return here to add the connector.
Adding the SAP Business One CRM connector
Step 1: Open the connector palette
Select Add Connection in the Connections section.
Step 2: Select the SAP Business One CRM connector
- Enter
sap.businessone.crmin the search field. - Select the Crm connector card.
Configuring the SAP Business One CRM connection
Step 3: Bind the connection parameters to configurable variables
Bind each connection field to its corresponding configurable variable.
- Session : Supplies the SAP Business One Service Layer credentials.
- Config : Keeps optional client settings at their default values.
- Service Url : Supplies the target SAP Business One Service Layer URL.
- Connection Name : Identifies the saved connection as
crmClient.
Step 4: Save the connection
Select Save Connection and verify that crmClient appears in the Connections section.
Step 5: Set actual values for your configurables
- Select Configurations at the bottom of the project tree under Data Mappers.
- Enter a value for each configurable before you run the integration.
- companyDb (
string) : Specifies the SAP Business One company database. - userName (
string) : Specifies the SAP Business One user name. - password (
string) : Specifies the SAP Business One password. - serviceUrl (
string) : Specifies the SAP Business One Service Layer URL.
Configuring the SAP Business One CRM List Sales Opportunities operation
Step 6: Add an automation entry point
- Select Add Entry Point next to Entry Points.
- Select Automation.
- Select Create to accept the default settings.
Step 7: Expand the connection and configure the List Sales Opportunities operation
- Select Add Step in the automation flow.
- Expand crmClient to display its operations.
- Select List Sales Opportunities.
- Review the generated result settings. This operation has no required parameters.
- Result : Stores the returned sales opportunities collection.
- Select Save.
Step 8: Log the List Sales Opportunities result
- Select Add Step below the connector operation.
- Expand Logging.
- Select Log Info.
- Switch Msg to Expression mode.
- Enter
crmSalesopportunitiescollectionresponse.toString(). - Select Save.
- Msg : Converts the returned collection to text for the integration log.
Try it yourself
Try this sample in WSO2 Integration Platform.
More code examples
The SAP Business One connectors provide practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like listing open sales orders, reporting inventory stock, and logging CRM activities.





