Web Integration Quick Guide

Embed Size (px)

Citation preview

  • 8/3/2019 Web Integration Quick Guide

    1/16

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

    Web Integration Quick Guide

    LS Retail NAV

    2009.2 - 6.2

    Quick Guides

    Author: Stefan Konradsson

    Anna O. BjornssonDate: 01.25.2011

  • 8/3/2019 Web Integration Quick Guide

    2/16

    LS Retail ehf.Hofdatun 2, 105 Reykjavk, Iceland

    Tel: +354 414 5700 Fax: +354 414 5710

    Contents1 Introduction ....................................................................................................................... 12 How to Use the Web Integration Module ....................................................................... 2

    2.1 Displayed tables ....................................................................................................... 23 Use Cases and Business Processes .............................................................................. 4

    3.1 How to Setup ............................................................................................................ 43.1.1 How to Activate ............................................................................................ 43.1.2 How to Activate Store .................................................................................. 4

    3.2 How to Use ............................................................................................................... 44 New Objects ...................................................................................................................... 5

    4.1 New Objects ............................................................................................................. 54.1.1 XMLports ...................................................................................................... 84.1.2 XMLports .................................................................................................... 13

  • 8/3/2019 Web Integration Quick Guide

    3/16

    Web Integration Quick Guide

    Chapter 1 - Introduction 1

    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 tableto 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 thesomewhat 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 storeto make simple lookup requests, including Contact, Customer, Loyalty Card, Coupon andInventory.

    The third phase includes new web service request integration to be used by the web store tomake a basket lookup request that is sending a basket (transaction) and getting basketcalculated 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 beimplemented so that integration through NAV NAS should be a possible addition in laterphases.

  • 8/3/2019 Web Integration Quick Guide

    4/16

    Web Integration Quick Guide

    Chapter 2 - How to Use the Web Integration Module 2

    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 ofwhat 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 tobe published according to the normal procedure in NAV. Go to Administration, GeneralSetup Web Services and activate Codeunit 10012861 WI Services, WebStore. It ispublished by checking the Published field.

    What needs to be published is a codeunit, the 10012861 WI Services, a new web servicecodeunit for the WI module. This is the only codeunit that is published as web service entrypoint for the WI module. This codeunit loads the xml request document and diverts therequest to the corresponding function. This codeunit also returns the corresponding xmlresponse document to the requesting object.

    Another codeunit that needs special attention is: Codeunit10012860 WI Mgt. This is a new

    management codeunit for the WI module. The codeunit includes functions to collect changeddata to update WI tables. All items that are supposed to be valid in the web store need to bedefined in the Item Distribution table for each web store. The process is a combination ofcollecting changed data from the action changes log and items in the daily update table. Theeffort is limited to what has changes and what has the highest chance of being a changingbase 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 storesare web integration active. Those tables have GUI for users to access them, but other tableshave no GUI defined as they are only used behind the scenes for data collection. WI table areupdated by running a batch job to collect data. The main data collection is base for what haschanged according to the Preaction / Action table. This process is similar to the item labelsprocess. In this phase we are only interested in defining the data collection table and thecollection process. These data collection table are then replicated to the web store, but that isoutside of this document scope.

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

  • 8/3/2019 Web Integration Quick Guide

    5/16

    Web Integration Quick Guide

    Chapter 2 - How to Use the Web Integration Module 3

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

  • 8/3/2019 Web Integration Quick Guide

    6/16

    Web Integration Quick Guide

    Chapter 3 - Use Cases and Business Processes 4

    3 Use Cases and Business Processes

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

    3.1 How to Setup

    3.1.1 How to Activate

    Go to WI Setup form: LS Retail -BackOffice, Setup, Web Integration, Setup. In this formyou 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 formyou can activate or deactivate which stores are active in the WI module. Note that this tablealso 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 bedone 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 thecollection table form the Object Designer.

  • 8/3/2019 Web Integration Quick Guide

    7/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 5

    4 New Objects

    4.1 New Objects

    Table 10012860 WI SetupThis is a new table that holds general setup form the WI module.

    Field No. Name Description

    1 Code Holds a blank primary value of the setup record.

    10 WI in UseA checkmark in this field indicates that the WImodule is in use

    Table 10012860 WI PriceThis is a new table that holds collected retail price date for valid WI items. The table isgenerated from Prices and Promotion Offers to create retail price and making it easy for WebStores to find the correct retail price for the items.

    Field No. Name Description

    1 Store No.The Store Number of the web store. Will not beblank. [key field]

    2 Item No. Item number of the item. [key field]

    3 Variant Code

    Variant code of the item in combination with theitem no. the item is identified. If the field is blankthen item has no variants or the price is valid for allvariants. [key field]

    10 Customer Disc. GroupGrouping of customer discounts. The field isdefined on the customer record. [key field]

    11 Loyalty Scheme Code

    The code of the loyalty scheme / loyalty program

    the price is valid for. If blank then the price is validfor all loyalty schemes. [key field]

    12 Currency Code Currency code of the price (phase 2).

    20 Unit Price The valid retail price.

    21 Unit of Measure CodeUnit of Measure Code of the price (phase 2). In thisphase price is base on sales unit of measure.

    22 Offer No. The retail offer that triggered the price.

    30 Last Modified Date The date when this record vas last modified.

    Table 10012862 WI DiscountsThis is a new table used to hold valid Discount Offers and Multibuy Discounts. The table isgenerated 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 Description

    1 Store No.The Store Number of the web store. Will not beblank. [key field]

    2 Priority No.The higher the number is the higher priority.[key field]

    3 Item No. Item number of the item. [key field]

    4 Variant Code

    Variant code of the item in combination with the

    item no. the item is identified. If the field is blankthen item has no variants or the price is valid for all

  • 8/3/2019 Web Integration Quick Guide

    8/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 6

    variants. [key field]

    10 Customer Disc. GroupGrouping of customer discounts. The field isdefined on the customer record. [key field]

    11 Loyalty Scheme Code

    The code of the loyalty scheme / loyalty programthe price is valid for. If blank then the price is valid

    for all loyalty schemes. [key field]

    12 From DateThe date the price is valid from. The date isinclusive. [key field]

    13 To DateThe date the price is valid until. The date isinclusive. [key field]

    14 Minimum QuantityThe quantity of the transaction has to be equal orgreater so the price is valid. [key field]

    20 Discount % The discount % to the retail price.

    21 Unit of Measure CodeUnit of Measure Code of the item. Note only validwhen item is specified in offer.

    22 Currency Code Currency code of the price (phase 2).

    23 Offer No. The retail offer that triggered the discount.30 Last Modify Date The date when this record vas last modified.

    Table 10012863 WI Mix & Match OfferThis is a new table used to hold valid Mix & Match Offers. The table is generated from Mixand Match Offers in order to be able to show in what Mix and Match Offer the item belongs toselecting the item at web.

    Field No. Name Description

    1 Store No.The Store Number of the web store. Will not beblank. [key field]

    2 Item No. Item number of the item. [key field]

    3 Variant Code

    Variant code of the item in combination with theitem no. the item is identified. If the field is blankthen item has no variants or the price is valid for allvariants. [key field]

    10 Customer Disc. GroupGrouping of customer discounts. The field isdefined on the customer record. [key field]

    11 Loyalty Scheme Code

    The code of the loyalty scheme / loyalty programthe price is valid for. If blank then the price is validfor all loyalty schemes. [key field]

    12 From DateThe date the price is valid from. The date isinclusive. [key field]

    13 To DateThe date the price is valid until. The date isinclusive. [key field]

    20 Offer No. The retail offer that triggered the discount.

    30 Last Modify Date The date when this record vas last modified.

    Table 10012864 WI Offer HeaderThis is a new table used to hold all offer headers. The table holds all offers in the WI Price, WIDiscounts and WI Mix & Match Tables.

    Field No. Name Description

    1 No. The Offer number. [key field]

  • 8/3/2019 Web Integration Quick Guide

    9/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 7

    2 Description The description of the Offer.

    3 Status 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 Description

    1 Code The Loyalty Scheme Code. [key field]

    2 Description The default description of the Loyalty Scheme.

    Table 10012866 WI StoreThis is a new table that is used to hold all WI active stores.

    Field No. Name Description

    1 Store No.The Store Number of the web store. Will not beblank. [key field]

    60 Status The WI status of the store: Disabled, Enabled.

    100 Last Action Entry No.

    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 onlyinvestigate entries from that number to the end ofthe log file (Preaction / Action).

    Table 10012867 WI Item with Daily UpdatesThis is a new table used to hold list of all items that need to be investigated each time thebatch job is run. This includes all items that have date depending price changes, that is theprice table holds prices that is date dependent or the item is part of date depended promotion.

    Field No. Name Description

    1 Item No. Item number of the item. [key field]

    Table 10012868 WI Loyalty CardThis is a new table used to hold a list of all loyalty cards.

    Field No. Name Description

    1 Loyalty Card No Loyalty card number [key field]

    2 Link Type The link type of the card: Customer, Contact.

    5 Link No. Customer or Contact number.

    10 Loyalty Scheme CodeLoyalty Scheme Code that is connected to thecard.

    Table 10012869 WI CouponThis is a new table used to hold a list of all valid coupons.

    Field No. Name Description

    1 Code The Coupon number. [key field]

  • 8/3/2019 Web Integration Quick Guide

    10/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 8

    2 From DateThe date the price is valid from. The date isinclusive. [key field]

    3 To DateThe date the price is valid until. The date isinclusive. [key field]

    4 Store No.The Store Number of the web store. Will not beblank. [key field]

    5 Blocked If set then coupon is blocked from usage.

    10 Description The default description of the coupon.

    20 Discount Type Discount type: Amount, Discount %.

    21 Discount Value The discount amount or the discount %.

    Table 10012870 WI Inv. Req. BufferThis is a new internal table that is used to temporary hold inventory requests. Web store hasthe ability to look up the inventory quantity for specific item number and variant code for aspecific location code.

    Field No. Name Description

    1 Item No. Item number of the item. [key field]

    2 Variant Code Variant code of the item. [key field]

    3 Store No. The Store Number. [key field]

    4 Location Code

    The Location Code. If location code is blank thenthe WS will used the sales location code of thestore. [key field]

    Table 10012871 WI Inv. Buffer

    This is a new internal table that is used to temporary hold inventory response, that is theresult of an inventory request.

    Field No. Name Description

    1 Item No.Item number of the item. [key field]

    2 Variant CodeVariant code of the item. [key field]

    3 Store No.The Store Number. [key field]

    4 Location Code The Location Code. [key field]

    10 Inventory The quantity on hand

    11 Safety Quantity Safety quantity

    12 Special Order Item Set if the product is a special order item.

    4.1.1 XMLports

    XMLport 10012860 WI Default ResponseThis is a new XMLport to construct basic xml response document. Used for default errorresponse as for example the request is invalid or unknown.

    Indent Node Name Description

    0

    The top node of the xml document.

    1 Node the holds the request id.

  • 8/3/2019 Web Integration Quick Guide

    11/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 9

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    XMLport 10012861 WI Cust. Req.This is a new XMLport to import xml customer request document.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCUSTOMER.

    1 The top node holding the request fields.

    2 Node that holds the requested customer no.

    XMLport 10012862 WI Cust. ResponseThis is a new XMLport to construct xml response document for customer requests.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCUSTOMER.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 Node that holds the requested customer no.

    2 Node that holds the customer name.

    2 Node that holds the blocking status of thecustomer. Status 0 customer in not blocked.

    2 Node that holds the customer discount group.

    XMLport 10012863 WI Cont. Req.This is a new XMLport to import xml contact request document.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCONTACT.

    1 The top node holding the request fields.

    2 Node that holds the requested contact no.

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

  • 8/3/2019 Web Integration Quick Guide

    12/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 10

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCONTACT.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 Node that holds the requested contact no.

    2 Node that holds the contact name.

    XMLport 10012865 WI Loyalty Card Req.

    This is a new XMLport to import xml loyalty card request document.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseLOYALTYCARD.

    1 The top node holding the request fields.

    2 Node that holds the requested card no.

    XMLport 10012866 WI Loyalty Card ResponseThis is a new XMLport to construct xml response document for loyalty card requests.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseLOYALTYCARD.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 Node that holds the requested card no.

    2 Node that holds the linked type (contact,customer).

    2 Node that holds the contact / customer no. that thiscard is linked to.

    2 Node that holds the cards loyalty scheme.

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

  • 8/3/2019 Web Integration Quick Guide

    13/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 11

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCOUPON.

    1

    The top node holding the request fields.

    2 Node that holds the requested coupon no.

    2 Node that holds the language code selected at theweb store.

    XMLport 10012868 WI Coupon ResponseThis is a new XMLport to construct xml response document for coupon requests.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseCOUPON.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 Node that holds the requested coupon no.

    2 Node that holds the description of the coupon.

    2

    Node that holds the coupon description in defined

    language code. If record is not found for a specificlanguage it will return the default description.

    2 Node that holds the discount type (DiscountAmount, Discount %).

    2 Node that holds the discount amount or thediscount %.

    2 If set then coupon is blocked from usage.

    XMLport 10012869 WI Inv. Req.This is a new XMLport to import xml inventory request document.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseINVENTOY.

    1 The top node holding the request fields.

    2 Node that holds the requested item no.

    2 Node that holds the requested variant code.

    2

    Node that holds the requested store no. If no storeno. is provided then the request applies to allstores. Inventory is only reported for store sales

    locations.

    2 Node that holds the requested location code. If no

  • 8/3/2019 Web Integration Quick Guide

    14/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 12

    location code is provided then the request appliesto the sales location of the store. Note that thisnode is always considered as an extra filtering forlocation of the store and can therefore not be usealone without the store.

    XMLport 10012870 WI Inv. ResponseThis is a new XMLport to construct xml response document for coupon requests.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseINVENTORY.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 The top node of each response line (record).

    3 Node that holds the item no.

    3 Node that holds the variant code of the item.

    3 Node that holds the store no. of the inventory onhand.

    3 Node that holds the location code of the inventoryon hand.

    3

    Node that holds the inventory (quantity) on hand.

    3 Node that holds the safety quantity.

    3 Node that holds a flag if the item is a special orderitem.

    Table 10012872 WI Basket Header BufferThis is a new internal table that is used to temporary hold basket header both request andresponse. Web store has the ability to send a basket (transaction) of items to be pricecalculated as it would on a POS.

    Field No. Name Description

    1 Code Primary basket key, blank in the version. [key field]

    10 Store No. The Store Number of the web store.

    11 Contact No. The contact Number of the buyer.

    12 Customer No. The customer Number of the buyer.

    13 Country Code The Country Code. Not used in the phase.

    14 Currency CodeThe Currency Code of the transaction. Not used inthis phase.

    15 Web Transaction GUID Web Transaction ID provided by web store.

    16 Loyalty Scheme Code The Loyalty Scheme Code.

    17 Loyalty Card No. The Loyalty Card Number

  • 8/3/2019 Web Integration Quick Guide

    15/16

    Web Integration Quick Guide

    Chapter 4 - New Objects 13

    18 Coupon No.The Coupon Number In this phase there will onlybe one coupon per transaction (basket).

    20 Basket Price The total basket price.

    Table 10012873 WI Basket line BufferThis is a new internal table that is used to temporary hold basket lines both request andresponse.

    Field No. Name Description

    1 CodePrimary basket key, blank in the version. [key field]

    2 Line No.The Line Number of the record within the basket.[key field]

    3 Item No.Item number of the item.

    4 Variant CodeVariant code of the item.

    5 Quantity

    Quantity of the item.

    6 Price Price of the item.

    7 Offer No. Offer Number of the item.

    8 Coupon No. Coupon Number of the item.

    4.1.2 XMLports

    XMLport 10012871 WI Basket Req.This is a new XMLport to import xml basket request document.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node that holds the request id. In this caseBASKET.

    1 The top node holding the request fields.

    2 The top node of the basket header.

    3 Node that holds the store number of the web store.

    3 Node that holds the contact number of the buyer.

    3 Node that holds the customer number of the buyer.

    3

    Node that holds the country code as supplied by

    the web store. Not used in this phase.

    3 Node that holds the currency code of the basket.Not used in this phase.

    3 Node that holds the web transaction ID as suppliedby the web store.

    3

    Node that holds the loyalty scheme code of thebuyer. If blank the system will try to find a validscheme by: loyalty card, contact and finallycustomer.

    3

    Node that holds loyalty card number of the buyer.Used to find Loyalty scheme if scheme is notprovided directly.

    3

    Node that holds a coupon number to be used withthis basket. In this phase there will be only onecoupon per transaction.

  • 8/3/2019 Web Integration Quick Guide

    16/16

    Web Integration Quick Guide

    Chapter 4 New Objects 14

    2 The top node for each basket line. Can occurmultiple times.

    3

    Node that holds the line number of the line withinthe basket. Should follow the POS transaction linestandard and start with line number 10000 andincrease by 10000 by each line.

    3 Node that holds the requested item no.

    3 Node that holds the requested variant code.

    3 Node that holds the requested quantity.

    3

    Node that holds the price that the web storeshowed to the customer. Giving the ability to logdifference in web price shown and calculated priceby the request. Not used in this phase.

    XMLport 10012872 WI Basket ResponseThis is a new XMLport to construct xml response document for basket requests.

    Indent Node Name Description

    0 The top node of the xml document.

    1 Node the holds the request id. In this caseBASKET.

    1

    Holds the response code. In case of an error thenthis node hold an identifier of the error. If no erroroccurs then the response code is 0000.

    1 Holds a further description of the response code ifnot 0000.

    1 The top node holding the response fields.

    2 The top node of the basket header.

    3 Node that holds the store number of the web store.

    3 Node that holds the customer number of the buyer.

    3 Node that holds the loyalty scheme code of thebuyer.

    3 Node that holds the total basket price.

    2 The top node for each basket line. Can occurmultiple times.

    3

    Node that holds the line number of the line withinthe basket. Should follow the POS transaction line

    standard and start with line number 10000 andincrease by 10000 by each line.

    3 Node that holds the requested item no.

    3 Node that holds the requested variant code.

    3 Node that holds the requested quantity.

    3 Node that holds the calculated price by therequest. This is price including all discounts.

    3 Node that holds the offer number that affected theprice calculation.

    3 Node that holds the coupon number that affectedthe price calculation.