This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw2:sbo_sl_v26 [2021/02/11 15:36] akoehler [Working with the Service Layer] |
bw2:sbo_sl_v26 [2022/08/23 14:26] (current) akoehler |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== SAP Business One Service Layer using Bizweaver v2.6 and higher ===== | ===== SAP Business One Service Layer using Bizweaver v2.6 and higher ===== | ||
| - | Accessing SAP Business One using the Service Layer is a two-step process. The first step (Login) responds with two cookies. These cookies are then used in any subsequent web service calls in the current processing cycle. | + | Accessing SAP Business One using the Service Layer is a two-step process. The first step (Log in) responds with two cookies. These cookies are then used in any subsequent web service calls in the current processing cycle. |
| <WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
| - | Accessing SAP Business One via the Service Layer is available for HANA on v9.3 only. It is available for both HANA and SQL Server beginning with SAP Business One v10 PL02. | + | Accessing SAP Business One via the Service Layer is available for HANA on v9.3 only. It is available for both HANA and SQL Server, beginning with SAP Business One v10 PL02. |
| </ | </ | ||
| Line 56: | Line 56: | ||
| * Select the fields that need to be updated. | * Select the fields that need to be updated. | ||
| * Enter the values for the selected fields. | * Enter the values for the selected fields. | ||
| - | * **When updating records in SAP it is best to update the whole record | + | * **When updating records in SAP, it is best to update the whole record |
| ===Delete=== | ===Delete=== | ||
| * **Delete** will delete the indicated record id. | * **Delete** will delete the indicated record id. | ||
| Line 65: | Line 65: | ||
| ==== Working with the Service Layer ==== | ==== Working with the Service Layer ==== | ||
| - | Information on sending data through the Service Layer is found **// | + | Information on sending data through the Service Layer including attachments |
| ====== Sample Building JSON for SAP Business One Service Layer ====== | ====== Sample Building JSON for SAP Business One Service Layer ====== | ||
| ===== Workflow ===== | ===== Workflow ===== | ||
| - | This workflow builds | + | This workflow builds |
| - | {{ :bw:databuilder1.png? | + | {{ :bw2:bizweaversl26_5.png |}} |
| - | ===== Create Main DataBuilder Step ===== | + | ===== Gather Header Information |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | This should always contain the first items of the data structure. | + | |
| - | + | ||
| - | - Enter a workflow step name. | + | |
| - | - Select the data source from the Datasource Object drop-down list. | + | |
| - | - Select the desired data structure type to be created (JSON or XML). | + | |
| - | - Leave the “Add as an array” checkbox cleared unless you know that the top-level object needs to be any array. This is uncommon. | + | |
| - | - Select the " | + | |
| - | - This option causes the " | + | |
| - | - Enter the name of the top-level object. | + | |
| - | - The requirements of the receiving API will determine this. | + | |
| - | - In some cases, a top-level object name is not used; e.g. SAP Service Layer and BigCommerce. | + | |
| - | - If a top-level object name is not used, leave the field blank. | + | |
| - | - Create a row for each value to be included in the structure. | + | |
| - | - Enter the output field name values in the right-side grid. | + | |
| - | - The Field Name value will need to exactly match (including case) the value the API is expecting. | + | |
| - | - Select the field type from the drop-down list. | + | |
| - | - Press < | + | |
| - | + | ||
| - | Continue this process for all desired fields in the top-level object. | + | |
| - | + | ||
| - | The data structure being built is displayed in the left-side panel as elements are added. | + | |
| - | The data structure cannot be altered in this area. The display is for information only. | + | |
| + | In this example, we are using the SQL/Tool to gather all the relevant header information. This will be entered directly into the WebService step using the SAP Service Layer Connector. | ||
| ===== Create the Lower-Level DataBuilder Step(s) ===== | ===== Create the Lower-Level DataBuilder Step(s) ===== | ||
| - | {{ :bw:databuilder3.png? | + | {{ :bw2:bizweaversl26_6.png |}} |
| - | This will be the next section in the expected data structure. The process is the same as described in the “Main DataBuilder” step. | + | This will be the next section in the expected data structure |
| - | For objects such as a set of rows, the display will only display a single entry. However, all data received as input will be included when the workflow executes. | + | ===== Reference Lower-level Objects in the WebServices Step ===== |
| - | <WRAP center round tip 80%> | + | Once the DataBuilder steps for the lower-level |
| - | In most cases the lower-level | + | |
| - | </ | + | |
| - | <WRAP center round important 80%> | + | * Press F4 to select |
| - | When creating lower-level section that __may__ have more than one entry (i.e. an array), be sure to put the DataBuilder tool within a **Loop**. | + | {{ : |
| - | </ | + | |
| + | * Once the basic structure is there, you can test run the workflow and check to ensure it runs successfully. | ||
| - | + | ==== Sending Data to the Service Layer ==== | |
| - | All objects other than the main one will require an Object Name. This must exactly match (including case) what is expected by the API. | + | Information on sending |
| - | + | ||
| - | ===== Reference Lower-level Objects in the Main DataBuilder Step ===== | + | |
| - | + | ||
| - | Once the DataBuilder steps for the lower-level objects have been created, they can be referenced in the main DataBuilder step. This is what causes the entire | + | |
| - | + | ||
| - | - Click the “Field Type” drop-down in the main DataBuilder step. The names of the lower-level objects are displayed in addition | + | |
| - | - Select the desired object. | + | |
| - | - The Field Name and Value are automatically filled in. | + | |
| - | - The lower-level object is displayed in the left-side data structure. | + | |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | Here is the resulting JSON that is sent in the API call. | + | |
| - | + | ||
| - | <code json> | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | ], | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | } | + | |
| - | ] | + | |
| - | } | + | |
| - | </code> | + | |
| - | ===== Reference the Output of the Main DataBuilder Step in the API Call ===== | + | |
| - | + | ||
| - | The output of the main DataBuilder step is used in the API call. This is done by using the “**CumulativeData**” variable from the Main DataBuilder step. An example is shown in the image below. | + | |
| - | + | ||
| - | {{ : | + | |