Sie sind auf Seite 1von 16

Web Integration Quick Guide

LS Retail NAV
2009.2 - 6.2

Quick Guides

Author: Stefan Konradsson Anna O. Bjornsson Date: 01.25.2011

Copyright 2011, LS Retail ehf. All rights reserved. All trademarks belong to their respective holders.

Contents
1 2 3 Introduction....................................................................................................................... 1 How to Use the Web Integration Module ....................................................................... 2 2.1 Displayed tables ....................................................................................................... 2 Use Cases and Business Processes .............................................................................. 4 3.1 How to Setup............................................................................................................ 4 3.1.1 How to Activate ............................................................................................ 4 3.1.2 How to Activate Store .................................................................................. 4 3.2 How to Use............................................................................................................... 4 New Objects ...................................................................................................................... 5 4.1 New Objects ............................................................................................................. 5 4.1.1 XMLports ...................................................................................................... 8 4.1.2 XMLports .................................................................................................... 13

LS Retail ehf. Hofdatun 2, 105 Reykjavk, Iceland Tel: +354 414 5700 Fax: +354 414 5710

Web Integration Quick Guide

1 Introduction
The following notes cover the Web Integration Module. The first phase in adding web store integration to LS Retail NAV includes a new simple table to be used by the web store to find retail price, offers and other price-related information. It also includes a process to update those tables by using batch job. This is done to convert the somewhat complex LS Retail price structure into as simple form as possible. The second phase includes new web service request integration to be used by the web store to make simple lookup requests, including Contact, Customer, Loyalty Card, Coupon and Inventory. The third phase includes new web service request integration to be used by the web store to make a basket lookup request that is sending a basket (transaction) and getting basket calculated as it would on a POS. The web service communication for the second and third phase is done by XML documents. In these steps the service will only be provided by NAV web service, but should be implemented so that integration through NAV NAS should be a possible addition in later phases.

Chapter 1 - Introduction

Web Integration Quick Guide

2 How to Use the Web Integration Module


It is up to the users to decide how to utilize the Web Integration Module. Giving an overview of what data has been collected and made available is the main purpose of these notes. The users have to be familiar with how web services are normally used in NAV. To be able to use this web service NAV has to be correctly set up and the following web service needs to be published according to the normal procedure in NAV. Go to Administration, General Setup Web Services and activate Codeunit 10012861 WI Services, WebStore. It is published by checking the Published field.

What needs to be published is a codeunit, the 10012861 WI Services, a new web service codeunit for the WI module. This is the only codeunit that is published as web service entry point for the WI module. This codeunit loads the xml request document and diverts the request to the corresponding function. This codeunit also returns the corresponding xml response document to the requesting object. Another codeunit that needs special attention is: Codeunit 10012860 WI Mgt. This is a new management codeunit for the WI module. The codeunit includes functions to collect changed data to update WI tables. All items that are supposed to be valid in the web store need to be defined in the Item Distribution table for each web store. The process is a combination of collecting changed data from the action changes log and items in the daily update table. The effort is limited to what has changes and what has the highest chance of being a changing base on its own setup, like date limits and similar.

2.1

Displayed tables

There are two setup tables used to define if the module is active and to define which stores are web integration active. Those tables have GUI for users to access them, but other tables have no GUI defined as they are only used behind the scenes for data collection. WI table are updated by running a batch job to collect data. The main data collection is base for what has changed according to the Preaction / Action table. This process is similar to the item labels process. In this phase we are only interested in defining the data collection table and the collection process. These data collection table are then replicated to the web store, but that is outside of this document scope.

Form 10012860 WI Setup This is a new form where the user can activate or deactivate the WI module.

Chapter 2 - How to Use the Web Integration Module

Web Integration Quick Guide

Form 10012860 WI Store This is a new form where the user can activate or deactivate stores form the WI module.

Chapter 2 - How to Use the Web Integration Module

Web Integration Quick Guide

3 Use Cases and Business Processes


The WI module can be activated or deactivated independent of other parts of the system.

3.1
3.1.1

How to Setup
How to Activate

Go to WI Setup form: LS Retail - BackOffice, Setup, Web Integration, Setup. In this form you can activate or deactivate the WI module.

3.1.2

How to Activate Store

Go to WI Store form: LS Retail - BackOffice, Setup, Web Integration, WI Store. In this form you can activate or deactivate which stores are active in the WI module. Note that this table also holds the last action entry no. for each store.

3.2

How to Use

The day to day process is done by batch job that runs the collect update process. This can be done by any schedule job that would run codeunit 10012860 WI Mgt. No forms are defined to access the collected data so to view the data a user has to run the collection table form the Object Designer.

Chapter 3 - Use Cases and Business Processes

Web Integration Quick Guide

4 New Objects
4.1 New Objects
Table 10012860 WI Setup This is a new table that holds general setup form the WI module. Field No. Name 1 10 Code WI in Use Description Holds a blank primary value of the setup record. A checkmark in this field indicates that the WI module is in use

Table 10012860 WI Price This is a new table that holds collected retail price date for valid WI items. The table is generated from Prices and Promotion Offers to create retail price and making it easy for Web Stores to find the correct retail price for the items. Field No. Name 1 2 Store No. Item No. Description The Store Number of the web store. Will not be blank. [key field] Item number of the item. [key field] Variant code of the item in combination with the item no. the item is identified. If the field is blank then item has no variants or the price is valid for all variants. [key field] Grouping of customer discounts. The field is defined on the customer record. [key field] The code of the loyalty scheme / loyalty program the price is valid for. If blank then the price is valid for all loyalty schemes. [key field] Currency code of the price (phase 2). The valid retail price. Unit of Measure Code of the price (phase 2). In this phase price is base on sales unit of measure. The retail offer that triggered the price. The date when this record vas last modified.

3 10

Variant Code Customer Disc. Group

11 12 20 21 22 30

Loyalty Scheme Code Currency Code Unit Price Unit of Measure Code Offer No. Last Modified Date

Table 10012862 WI Discounts This is a new table used to hold valid Discount Offers and Multibuy Discounts. The table is generated from Discount Offers and Multibuy Offers to make it easy for Web Stores to find the % discount to the Retail Prices table. Finds the most specific record. Field No. Name 1 2 3 Store No. Priority No. Item No. Description The Store Number of the web store. Will not be blank. [key field] The higher the number is the higher priority. [key field] Item number of the item. [key field] Variant code of the item in combination with the item no. the item is identified. If the field is blank then item has no variants or the price is valid for all

Variant Code

Chapter 4 - New Objects

Web Integration Quick Guide

variants. [key field] 10 Customer Disc. Group Grouping of customer discounts. The field is defined on the customer record. [key field] The code of the loyalty scheme / loyalty program the price is valid for. If blank then the price is valid for all loyalty schemes. [key field] The date the price is valid from. The date is inclusive. [key field] The date the price is valid until. The date is inclusive. [key field] The quantity of the transaction has to be equal or greater so the price is valid. [key field] The discount % to the retail price. Unit of Measure Code of the item. Note only valid when item is specified in offer. Currency code of the price (phase 2). The retail offer that triggered the discount. The date when this record vas last modified.

11 12 13 14 20 21 22 23 30

Loyalty Scheme Code From Date To Date Minimum Quantity Discount % Unit of Measure Code Currency Code Offer No. Last Modify Date

Table 10012863 WI Mix & Match Offer This is a new table used to hold valid Mix & Match Offers. The table is generated from Mix and Match Offers in order to be able to show in what Mix and Match Offer the item belongs to selecting the item at web. Field No. Name 1 2 Store No. Item No. Description The Store Number of the web store. Will not be blank. [key field] Item number of the item. [key field] Variant code of the item in combination with the item no. the item is identified. If the field is blank then item has no variants or the price is valid for all variants. [key field] Grouping of customer discounts. The field is defined on the customer record. [key field] The code of the loyalty scheme / loyalty program the price is valid for. If blank then the price is valid for all loyalty schemes. [key field] The date the price is valid from. The date is inclusive. [key field] The date the price is valid until. The date is inclusive. [key field] The retail offer that triggered the discount. The date when this record vas last modified.

3 10

Variant Code Customer Disc. Group

11 12 13 20 30

Loyalty Scheme Code From Date To Date Offer No. Last Modify Date

Table 10012864 WI Offer Header This is a new table used to hold all offer headers. The table holds all offers in the WI Price, WI Discounts and WI Mix & Match Tables. Field No. Name 1 No. Description The Offer number. [key field]

Chapter 4 - New Objects

Web Integration Quick Guide

2 3

Description Status

The description of the Offer. The status of the offer: Disabled, Enabled.

Table 10012865 WI Loyalty Scheme This is a new table that is used to hold all active Loyalty Schemes. Field No. Name 1 2 Code Description Description The Loyalty Scheme Code. [key field] The default description of the Loyalty Scheme.

Table 10012866 WI Store This is a new table that is used to hold all WI active stores. Field No. Name 1 60 Store No. Status Description The Store Number of the web store. Will not be blank. [key field] The WI status of the store: Disabled, Enabled. Internal field that holds the highest Preaction / Action entry no. that data has been collected form. Next time the collection batch is run it will only investigate entries from that number to the end of the log file (Preaction / Action).

100

Last Action Entry No.

Table 10012867 WI Item with Daily Updates This is a new table used to hold list of all items that need to be investigated each time the batch job is run. This includes all items that have date depending price changes, that is the price table holds prices that is date dependent or the item is part of date depended promotion. Field No. Name 1 Item No. Description Item number of the item. [key field]

Table 10012868 WI Loyalty Card This is a new table used to hold a list of all loyalty cards. Field No. Name 1 2 5 10 Loyalty Card No Link Type Link No. Loyalty Scheme Code Description Loyalty card number [key field] The link type of the card: Customer, Contact. Customer or Contact number. Loyalty Scheme Code that is connected to the card.

Table 10012869 WI Coupon This is a new table used to hold a list of all valid coupons. Field No. Name 1 Code Description The Coupon number. [key field]

Chapter 4 - New Objects

Web Integration Quick Guide

2 3 4 5 10 20 21

From Date To Date Store No. Blocked Description Discount Type Discount Value

The date the price is valid from. The date is inclusive. [key field] The date the price is valid until. The date is inclusive. [key field] The Store Number of the web store. Will not be blank. [key field] If set then coupon is blocked from usage. The default description of the coupon. Discount type: Amount, Discount %. The discount amount or the discount %.

Table 10012870 WI Inv. Req. Buffer This is a new internal table that is used to temporary hold inventory requests. Web store has the ability to look up the inventory quantity for specific item number and variant code for a specific location code. Field No. Name 1 2 3 Item No. Variant Code Store No. Description Item number of the item. [key field] Variant code of the item. [key field] The Store Number. [key field] The Location Code. If location code is blank then the WS will used the sales location code of the store. [key field]

Location Code

Table 10012871 WI Inv. Buffer This is a new internal table that is used to temporary hold inventory response, that is the result of an inventory request. Field No. Name 1 2 3 4 10 11 12 4.1.1 Item No. Variant Code Store No. Location Code Inventory Safety Quantity Special Order Item XMLports Description Item number of the item. [key field] Variant code of the item. [key field] The Store Number. [key field] The Location Code. [key field] The quantity on hand Safety quantity Set if the product is a special order item.

XMLport 10012860 WI Default Response This is a new XMLport to construct basic xml response document. Used for default error response as for example the request is invalid or unknown. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id.

Chapter 4 - New Objects

Web Integration Quick Guide

1 1

<Response_Code> <Response_Text>

Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000.

XMLport 10012861 WI Cust. Req. This is a new XMLport to import xml customer request document. Indent 0 1 1 2 Node Name <Request> <Request_ID> <Request_Body> <Customer_No> Description The top node of the xml document. Node the holds the request id. In this case CUSTOMER. The top node holding the request fields. Node that holds the requested customer no.

XMLport 10012862 WI Cust. Response This is a new XMLport to construct xml response document for customer requests. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id. In this case CUSTOMER. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. Node that holds the requested customer no. Node that holds the customer name. Node that holds the blocking status of the customer. Status 0 customer in not blocked. Node that holds the customer discount group.

1 1 1 2 2 2 2

<Response_Code> <Response_Text> <Request_Body> <Customer_No> <Cust_Name> <Cust_Blocked> <Cust_Disc_Group>

XMLport 10012863 WI Cont. Req. This is a new XMLport to import xml contact request document. Indent 0 1 1 2 Node Name <Request> <Request_ID> <Request_Body> <Contact_No> Description The top node of the xml document. Node the holds the request id. In this case CONTACT. The top node holding the request fields. Node that holds the requested contact no.

XMLport 10012864 WI Cont. Response This is a new XMLport to construct xml response document for contact requests.

Chapter 4 - New Objects

Web Integration Quick Guide

Indent 0 1

Node Name <Response> <Request_ID>

Description The top node of the xml document. Node the holds the request id. In this case CONTACT. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. Node that holds the requested contact no. Node that holds the contact name.

1 1 1 2 2

<Response_Code> <Response_Text> <Request_Body> <Contact_No> <Cont_Name>

XMLport 10012865 WI Loyalty Card Req. This is a new XMLport to import xml loyalty card request document. Indent 0 1 1 2 Node Name <Request> <Request_ID> <Request_Body> <Card_No> Description The top node of the xml document. Node the holds the request id. In this case LOYALTYCARD. The top node holding the request fields. Node that holds the requested card no.

XMLport 10012866 WI Loyalty Card Response This is a new XMLport to construct xml response document for loyalty card requests. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id. In this case LOYALTYCARD. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. Node that holds the requested card no. Node that holds the linked type (contact, customer). Node that holds the contact / customer no. that this card is linked to. Node that holds the cards loyalty scheme.

1 1 1 2 2 2 2

<Response_Code> <Response_Text> <Request_Body> <Card_No> <Type> <Cont_Cust_No> <Loyalty_Scheme>

XMLport 10012867 WI Coupon Req. This is a new XMLport to import xml coupon request document.

Chapter 4 - New Objects

10

Web Integration Quick Guide

Indent 0 1 1 2 2

Node Name <Request> <Request_ID> <Request_Body> <Coupon_No> <Language_Code>

Description The top node of the xml document. Node the holds the request id. In this case COUPON. The top node holding the request fields. Node that holds the requested coupon no. Node that holds the language code selected at the web store.

XMLport 10012868 WI Coupon Response This is a new XMLport to construct xml response document for coupon requests. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id. In this case COUPON. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. Node that holds the requested coupon no. Node that holds the description of the coupon. Node that holds the coupon description in defined language code. If record is not found for a specific language it will return the default description. Node that holds the discount type (Discount Amount, Discount %). Node that holds the discount amount or the discount %. If set then coupon is blocked from usage.

1 1 1 2 2

<Response_Code> <Response_Text> <Request_Body> <Coupon_No> <Description>

2 2 2 2

<Language_Description> <Discount_Type> <Discount_Value> <Blocked>

XMLport 10012869 WI Inv. Req. This is a new XMLport to import xml inventory request document. Indent 0 1 1 2 2 Node Name <Request> <Request_ID> <Request_Body> <Item_No> <Variant_Code> Description The top node of the xml document. Node the holds the request id. In this case INVENTOY. The top node holding the request fields. Node that holds the requested item no. Node that holds the requested variant code. Node that holds the requested store no. If no store no. is provided then the request applies to all stores. Inventory is only reported for store sales locations. Node that holds the requested location code. If no

2 2

<Store_No> <Location_Code>

Chapter 4 - New Objects

11

Web Integration Quick Guide

location code is provided then the request applies to the sales location of the store. Note that this node is always considered as an extra filtering for location of the store and can therefore not be use alone without the store.

XMLport 10012870 WI Inv. Response This is a new XMLport to construct xml response document for coupon requests. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id. In this case INVENTORY. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. The top node of each response line (record). Node that holds the item no. Node that holds the variant code of the item. Node that holds the store no. of the inventory on hand. Node that holds the location code of the inventory on hand. Node that holds the inventory (quantity) on hand. Node that holds the safety quantity. Node that holds a flag if the item is a special order item.

1 1 1 2 3 3 3 3 3 3 3

<Response_Code> <Response_Text> <Request_Body> <Response_Line> <Item_No> <Variant_Code> <Store_No> <Location_Code> <Inventory> <Safety_Quantity> <Special_Order_Item>

Table 10012872 WI Basket Header Buffer This is a new internal table that is used to temporary hold basket header both request and response. Web store has the ability to send a basket (transaction) of items to be price calculated as it would on a POS. Field No. Name 1 10 11 12 13 14 15 16 17 Code Store No. Contact No. Customer No. Country Code Currency Code Web Transaction GUID Loyalty Scheme Code Loyalty Card No. Description Primary basket key, blank in the version. [key field] The Store Number of the web store. The contact Number of the buyer. The customer Number of the buyer. The Country Code. Not used in the phase. The Currency Code of the transaction. Not used in this phase. Web Transaction ID provided by web store. The Loyalty Scheme Code. The Loyalty Card Number

Chapter 4 - New Objects

12

Web Integration Quick Guide

18 20

Coupon No. Basket Price

The Coupon Number In this phase there will only be one coupon per transaction (basket). The total basket price.

Table 10012873 WI Basket line Buffer This is a new internal table that is used to temporary hold basket lines both request and response. Field No. Name 1 2 3 4 5 6 7 8 4.1.2 Code Line No. Item No. Variant Code Quantity Price Offer No. Coupon No. XMLports Description Primary basket key, blank in the version. [key field] The Line Number of the record within the basket. [key field] Item number of the item. Variant code of the item. Quantity of the item. Price of the item. Offer Number of the item. Coupon Number of the item.

XMLport 10012871 WI Basket Req. This is a new XMLport to import xml basket request document. Indent 0 1 1 2 3 3 3 3 3 3 Node Name <Request> <Request_ID> <Request_Body> <Basket_Header> <Store_No> <Contact_No> <Customer_No> <Country_Code> <Currency_Code> <Web_Trans_GUID> Description The top node of the xml document. Node that holds the request id. In this case BASKET. The top node holding the request fields. The top node of the basket header. Node that holds the store number of the web store. Node that holds the contact number of the buyer. Node that holds the customer number of the buyer. Node that holds the country code as supplied by the web store. Not used in this phase. Node that holds the currency code of the basket. Not used in this phase. Node that holds the web transaction ID as supplied by the web store. Node that holds the loyalty scheme code of the buyer. If blank the system will try to find a valid scheme by: loyalty card, contact and finally customer. Node that holds loyalty card number of the buyer. Used to find Loyalty scheme if scheme is not provided directly. Node that holds a coupon number to be used with this basket. In this phase there will be only one coupon per transaction.

<Loyalty_Scheme>

<Loyalty_Card_No>

<Coupon_No>

Chapter 4 - New Objects

13

Web Integration Quick Guide

<Basket_Line>

3 3 3 3

<Line_No> <Item_No> <Variant_Code> <Quantity>

The top node for each basket line. Can occur multiple times. Node that holds the line number of the line within the basket. Should follow the POS transaction line standard and start with line number 10000 and increase by 10000 by each line. Node that holds the requested item no. Node that holds the requested variant code. Node that holds the requested quantity. Node that holds the price that the web store showed to the customer. Giving the ability to log difference in web price shown and calculated price by the request. Not used in this phase.

<Web_Price>

XMLport 10012872 WI Basket Response This is a new XMLport to construct xml response document for basket requests. Indent 0 1 Node Name <Response> <Request_ID> Description The top node of the xml document. Node the holds the request id. In this case BASKET. Holds the response code. In case of an error then this node hold an identifier of the error. If no error occurs then the response code is 0000. Holds a further description of the response code if not 0000. The top node holding the response fields. The top node of the basket header. Node that holds the store number of the web store. Node that holds the customer number of the buyer. Node that holds the loyalty scheme code of the buyer. Node that holds the total basket price. The top node for each basket line. Can occur multiple times. Node that holds the line number of the line within the basket. Should follow the POS transaction line standard and start with line number 10000 and increase by 10000 by each line. Node that holds the requested item no. Node that holds the requested variant code. Node that holds the requested quantity. Node that holds the calculated price by the request. This is price including all discounts. Node that holds the offer number that affected the price calculation. Node that holds the coupon number that affected the price calculation.

1 1 1 2 3 3 3 3 2

<Response_Code> <Response_Text> <Request_Body> <Basket_Header> <Store_No> <Customer_No> <Loyalty_Scheme> <Basket_Price> <Basket_Line>

3 3 3 3 3 3 3

<Line_No> <Item_No> <Variant_Code> <Quantity> <Price> <Offer_No> <Coupon_No>

Chapter 4 - New Objects

14

Das könnte Ihnen auch gefallen