Table of Contents

Live integration

Real time rendering of integrated data from a remote system

A Live integration is a DynamicWeb add-in that makes it possible to show e.g. live or customer-specific prices, live stock levels, or to have the remote system handle order, discount, and/or shipping fee calculations in real time. Configuring a live integration requires communication with a DynamicWeb plug-in unit installed on a remote system.

Data flow

How data is exchanged between DynamicWeb and the integrated remote system is somewhat dependent on the features implemented:

  • When a page with live prices and stock is rendered:
    • A list of product IDs or product numbers is sent to the remote system along with the ID of the current user
    • The plugin on the remote system then extracts prices and stock states for that user, and returns them
    • The products in memory are rendered with the returned prices – no data is saved in the database
  • When an order/shopping cart is calculated in the remote system:
    • Cart information (products IDs, quantities, user information) is sent to the remote system
    • The remote system calculates the cart with live prices, discounts, etc.
    • The updated cart is returned to DynamicWeb and saved to the database, then shown to the user
    • If an order is created in the remote system, the remote ID is also returned and saved, to ensure data consistency between the two systems

As such, a live integration requires an already existing integration between DynamicWeb and the remote system – you can’t request real-time information from nothing, so you need e.g. a ProductID and a UserID to request a customer-specific price, and the product must exist in the database before it can be shown in frontend. In other words, you will most likely have to configure relevant Data integration activities to exchange these data before configuring a live integration.

Installation

To install the live integration add-in in DynamicWeb, go to Apps > All apps, locate the Dynamicweb.Ecommerce.DynamicwebLiveIntegration package and click install.

Configuration

Once it has been installed, the Live Integration add-in is available from Integration > Setup > Live.

It consists of six tabs, which are used to configure different aspects of a live integration:

  • General – contains connectivity and other overall settings
  • Products – contains settings related to synchronizing product related information
  • Orders – contains settings that define how carts and orders are handled
  • Users – contains settings related to synchronizing users
  • Notifications – define how notifications are sent and when
  • Logs – configures the logging behavior of the connector

These are described in more detail below.

General

The General tab contains settings related to connectivity and other overall settings.

General settings in the live integration add-in

Setting Notes
Web Service URL Enter the URL to the web service exposed by the DynamicWeb Connector
Security key Enter the security key/secret you received from the DynamicWeb Connector service config file. Please notice that if you are using a cloud instance of D365 Business Central you should disregard the Security key field. Instead you should add an authentication to the endpoint. Please refer to the Endpoint collection documentation for more information on pairing endpoints and authentications
Endpoint Select one or more endpoints - if both an endpoint and a web service URL is selected the endpoint is used. This setting is typically used when you cannot install a connector service on the remote system, e.g. because the ERP is cloud-hosted
Connection timeout (seconds) Minimum value of 30 seconds
Interval between pings (seconds) Select the interval between pings in case of a connection error i.e. the frequency of attempts to reconnect. The shortest interval possible is 30 seconds. The timer stops when the connection is restored
Shop Select a shop for which the live integration is active – or set to Any to use it on all shops
Number format culture Select a number format culture to use when parsing information from the remote system
Global tag for connection availability Use this tag in frontend to notify customers when the connection to the ERP is down, and live features are unavailable. Format: @GetGlobalValue("WebServiceConnectionStatus")
InstanceId The automatically assigned ID for the live integration instance
SettingsFile The name of the file in which your configurations are stored. The file is stored in Assets in System > Integration > LiveIntegration

The live integration supports multiple endpoints, with each endpoint requiring a unique URL and a matching connector service – 2 endpoints = 2 connectors.

The URL syntax is [URL];[Field];[Value] - with the Field property retrieving data from either of these fields:

  • User.Company – AccessUserCompany column of table AccessUser
  • User.Department – AccessUserDepartment column of table AccessUser
  • User.[Any custom field] – System name(!) of any custom field column of table AccessUser
  • Order.[Any custom field] – Any custom field column of table EcomOrder
  • Session.Shop – ShopID of the shop in current http context

Edit the link directly (web service URL) or double-click an endpoint and add the parameters (endpoints).

Products

The Products tab contains settings related to retrieving live product information.

Product settings in the live integration add-in

Setting Notes
Enable live prices When enabled, prices are looked up in the remote system when shown in the frontend
Lazy load product info Skips loading prices and other product info from the remote system unless getproductinfo=true is in the request. This can be used for lazy loading scenarios using AJAX
Include product custom fields in request Whether to send the custom fields for a product to the ERP when request price and product information. If the ERP doesn’t need this information to determine the correct return values, leave this off for performance reasons
Product information cache level Sets caching to either page or session, depending on how important it is to continually update the information
Use unit prices This setting must be enabled when using the GetUnitPrices() extension method.
Use product number in price calculation When checked, the product number is sent to the remote system in place of the product Id. This is typically used on solutions where the PIM Combine feature is used. Should be combined with the Use product number in order calculation being set in the Orders tab
Retry request for the product information Whether or not the connector should retry the request for product information in case of a failure
Include variants in the product information request
Note

Please note that using the live integration to load products on a DynamicWeb Swift solution currently does not support loading stock amounts.

Orders

The Orders tab contains settings that define how carts and orders are handled.

Order settings in the live integration add-in

Setting Notes
Cart communication type Defines if and how the connector communicates with the ERP. The available options are: None – No carts or orders are sent to the ERP, Full – The connector communicates with the ERP for cart calculation as well as for full, completed orders, OnlyOnOrderComplete – DynamicWeb manages the cart, and only the completed order is sent to the ERP
Queue orders and allow payments if no connection Queues orders if no connection – they will be processed once the connection is re-established, provided that the appropriate integration activity is created - see previous section
Include order custom fields in request Includes order fields in the request
Include order line custom fields in request Includes order line fields in the request
Include parts order lines in request Includes Parts List order lines in the request
Save copy of order XML request Saves a copy of the original order XML request before any modifications – this is useful for debugging purposes if the order request is modified by e.g. a notification subscriber before being relayed to the remote system
Use product number in order calculation When checked, the product number is sent to the remote system in place of the product id. This is typically used on solutions where the PIM Combine feature is used. Should be combined with the Use product number in price calculation being set in the Products tab
Text for product discount order lines Product discounts returned by a remote system do not contain a description for showing in the cart and on an order – this allows you to define one manually. This key is translatable
Text for order discount order lines Order discounts returned by a remote system do not contain a description for showing in the cart and on an order – this allows you to define one manually. This key is translatable
ERP controls discount calculations Check this to have your ERP control discount calculations – only for D365 BC /NAV
Order state after export succeeded Set an order state to apply to the order after a successful export
ERP controls shipping calculations Check this to have your ERP control shipping fee calculations – only for D365 BC/NAV. If unchecked, shipping fees are calculated by DynamicWeb and pushed to the D365 BC sales order under the ERP shipping item key defined in the field below
ERP shipping item key If shipping fees are calculated by DynamicWeb, they are pushed to D365 BC/NAV item charge under the item key defined here. Defaults to DW-SHIP, but you can supply your own
Order state after export failed Set an order state to apply to the order after a failed export
Order cache level Sets caching to either page or session, depending on how important it is to continually update the information
Do not process ledger order If using the Ledger functionality, this prevents ledger order from being processed by the live integration

Users

The Users tab contains settings related to how anonymous users are handled.

Users setting in the live integration add-in

Setting Notes
Live product info for anonymous users Activates live product info for anonymous users
Carts and orders for anonymous users Activates cart and order calculation for anonymous users
ERP Anonymous user key Supply the name of the default customer in the remote system designated for B2C customers

Notifications

The Notifications tab defines how and when email notifications are sent when the live integration cannot connect to the remote system.

Notification settings in the live integration add-in

Setting Description
Notification recipient e-mail Enter an email address
Notification e-mail template Select an email template
Notification e-mail subject Enter an email subject
Notification e-mail sender name Specify a sender name
Notification e-mail sender e-mail Specify a sender email
Notification sending frequency Set a frequency – how often do you want to receive these emails?

Logs

The Logs tab allows you to configure the logging behavior of the live integration – this is particularly useful for debugging purposes, but can also be used for production.

Log settings in the live integration add-in

To top