2 Set Up Web Service
Before you can start replicating data from your LS Central in-cloud instance to Analytics in Azure, there are a few things you need to set up and check if they are in order in LS Central. If you are replicating from more than one company in LS Central you need to follow these steps for all companies. Each company must have their own web service.
Publish Retail web services
- In LS Central in-cloud, login as admin and navigate to Web Services.
- Search for Retail -> RetailWebServices (99009510) should be displayed in list.
- If you cannot find this service in the list, you must add it: press New and find the code unit (99009510). Be sure to use the name RetailWebServices.
- If you just added the RetailWebServices or if it is not published, you need to publish it by doing the following:
- Select Edit List from the top menu: the list becomes editable.
- Select the Publish check box in the line.
- Select Edit List from the top menu: the list stops being editable.
- In the list, locate the SOAP URL field for RetailWebServices, and copy the URL to Notepad for later use.
- Also search for GetActionsFromRemoteDB (99008933) and GetReplCountersFromRemoteDB (99008931) and add, and publish them if they do not exist.
Add web service password/key to user
- In LS Central, navigate to the Users list.
- Click the user name of the user you want to use for replication access. The User Card is displayed.
- In the Web Service Access FastTab:
- Click the three-dot button in the Web Service Access Key field, and set up a key.
- To copy the key, select the field and then copy the whole key with Ctrl+C.
- Paste the key to Notepad for later use.
Web service setup
- Navigate to the Web Service Setup page in LS Central.
- In the General FastTab:
- Turn on the Web Service is Active check box.
- In the Server FastTab:
- Paste the web service URI that you copied from RetailWebServices to the Web Service URI field.
This path should be similar to the example below, but reflect your company and instance:
https://lscentral.api.bc.dynamics.com/v2.0/696b709f-51ad-407e-83cd-e76c6e84843b/Production/WS/My%20Company/Codeunit/RetailWebServices
- In the Client Credentials FastTab:
- Turn on the Override Client Credentials check box.
- Add the user name and web service access key that you copied from the User Card to the appropriate fields.
- Navigate to a different field to save your changes.
- One last thing to check here is whether the Get Table Data web service has the correct optional fields.
- If you are in version 17.1 or lower, open Related - Web Service - Web requests.
- Search for Get Table Data, and then select the Get Table Data line and click Request xml from the menu.
- The following lines should have Optional column selected:
- Read_Direction
- Max_Number_Of_Records
- Ignore_Extra_Fields
- WS Table Filter Buffer
- WS Table Field Buffer
- WS Table Record Buffer
- Close Get Table Data.
- Close WS Request List.
- Close the Web Service Setup page.
Publish and subscribe to Web services
- Navigate to the Web Requests page in LS Central.
- Check that the Base URL matches the one you have set up in the Web Service Setup page (here it ends with the Company name)
- Click the Publisher action. This will publish all web services (everything is cleared from the web request list).
- Click the Subscriber action. This will create a subscription to all web services (everything reappears in the web request list with the correct URL)
Preaction setup
Before you start to replicate using preactions, the LS Central system must be set up to create those actions when things are added and changed. This is done by adding the Preaction Creation setup.
Retail setup
- Navigate to the Retail Setup page in LS Central.
- In the General FastTab:
- Make sure the Preaction Creation by field is set to Database Triggers.
- If it is not, set the field to Database Triggers, and then navigate to a different field to save the page.
- Click the Insert Default Data action.
- The LS Retail - Insert Default Data page opens. Click the Clear All to deselect everything.
- Turn on the Override Current Settings and Preaction Creation Setup check boxes in the list.
- Click the Insert action.
- This will insert the data needed to create preactions.
Scheduler setup
- Navigate to the Scheduler Setup page in LS Central.
- In the General FastTab:
- Turn on the Replicate using Preactions check box.
- If the check box is not active, turn it on and then navigate to a different field to save the card.
The cloud setup is now done and you can move on to what needs to be done on the Scheduler server.