# sapB1Call

## Description

This is a business management software (ERP) designed for small and medium-sized enterprises. As an ERP solution, it aims to automate key business functions in financials, operations, and human resources.

This function allows users to call the sapB1Call web service.

## Input / Parameter

| Name      | Description                                                           | Input Type  | Default | Options | Required |
| --------- | --------------------------------------------------------------------- | ----------- | ------- | ------- | -------- |
| connector | The name of the SAP B1 connector created in Services to connect to.   | String/Text | -       | -       | Yes      |
| function  | The function from the web service to be executed.                     | String/Text | -       | -       | Yes      |
| data      | The data containing the main parameters in the function being called. | Object      | -       | -       | Yes      |
| extra     | Extra parameters stored and passed to callback.                       | Any         | -       | -       | No       |

## Output

N/A

## Callback?

### callback

The function to be executed if the connection to SAP B1 connector is successful.

### errCallback

The function to be executed if the connection to SAP B1 connector is not successful.

## Video

Coming Soon.

## Example

The user wants to call the sapB1Call Web Service.

### Step

1. Create SAP B1 Connector in Services and define the name, url and timeOut.

   |         |                                                    |
   | ------- | -------------------------------------------------- |
   | Name    | sapb1                                              |
   | Url     | <http://203.116.137.100:51059/DemoApp/Sample.asmx> |
   | Timeout | 30000                                              |

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-99367527c7f266d7eca3552a15efa519f15df584%2FsapB1Call-step-1.png?alt=media)
2. Call the function "sapB1Call" and define the connector & function, set the function "toObject"to data.

   |           |           |
   | --------- | --------- |
   | connector | sapb1     |
   | function  | LoginDemo |
   | data      | toObject  |

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a37e2f064434739a0a62bf45ce211420f6474d64%2FsapB1Call-step-2.png?alt=media)
3. Define toObject.

   |                 |         |
   | --------------- | ------- |
   | CompanyUserName | manager |
   | CompanyPassword | 123456  |

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-b7b9749997b288089df8e15b3cd6232928df96ea%2FsapB1Call-step-3.png?alt=media)
4. Add a console after callback function for display response from console.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-698038449a59823a012e60a8865f0bc4187272e6%2FsapB1Call-step-4.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-1f54b3fdee86008a7da0fafe12a0b1fda7544ddf%2FsapB1Call-result-1.png?alt=media)

## Links
