Skip to main content

Importing Retail Transactions from POS to AX

Hi, regarding the synchronization of retail transaction from stores to HO, I received some inquiries what are the alternatives when there is an issue in the store that will prohibit Async Client from sending data to HO – for example, network issues, hardware failures.

Well, there is always the ever helpful DMF entities. It is limited – however, the 3 main tables needed to successfully Calculate Statements every end of day are all provided as standard entities.

If you are using the demo data from Contoso, chances are you will not be able to see these entities. However, go to Data import export framework à Setup à Target entities, just click New and drop down to Entity field and select as what has been provided above. This should automatically populate the columns Staging table, Entity Class and Target.

Note: If you have a legacy POS with transactions which you want to integrate with AX, you can just use this and just make sure that it will follow the template that you created for these entities in the Data import export framework à Common à Processing Group.

So, let’s do a quick sample for these entities. Won’t be detailing the actual creation of Processing Groups of DMF though.

Transaction header

Once you have already created a processing group for RetailTransactionTable, it should look something like this:

Generate a source file and select the fields that matters to you. The fields available here is limited but it’s very easy to customize. In this example, I will be using all the fields available except transTime and ValidFrom:

I did not include transTime because the field type of it in DMF is time, and in Channel DB, its integer – it can be converted though; ValidFrom is not available in the ChannelDB at all (if I’m not mistaken heh).

So what I usually do is, after I generate the sample file, I just copy the field names and add it in my SELECT statements. This is the select statement that I used:

SELECT
  FORMAT(SHIPPINGDATEREQUESTED, 'MM/dd/yyyy') as SHIPPINGDATEREQUESTED,
  STORE,
  TERMINAL,
  TRANSACTIONID,
  BATCHID,
  BATCHTERMINALID,
  FORMAT(BUSINESSDATE, 'MM/dd/yyyy') as BUSINESSDATE,
  COMMENT,
  COSTAMOUNT,
  CURRENCY,
  CURRENCY AS CURRENCYCODE,
  CUSTACCOUNT,
  DISCAMOUNT,
  ENTRYSTATUS,
  GROSSAMOUNT,
  NETAMOUNT,
  NUMBEROFITEMLINES,
  NUMBEROFITEMS,
  NUMBEROFPAYMENTLINES,
  PAYMENTAMOUNT,
  SHIFT,
  FORMAT(SHIFTDATE, 'MM/dd/yyyy') as SHIFTDATE,
  STAFF,
  FORMAT(TRANSDATE, 'MM/dd/yyyy') as TRANSDATE,
  TYPE
FROM AX.RETAILTRANSACTIONTABLE


You can modify according to your template, and add a where clause to select which record you want. I formatted here the dates so it’s easier to copy. :D If you run this statement in your Channel DB via SSMS, you can arrive into something like below:
If you right click from here, you can Save result as CSV or copy it with header – it’s up to you. I usually just save it into a file so that it can be directly imported to AX via DMF. After that, it’s just the normal process of Get Staging Data and Copy Data to Target in the Process Group.

Note: During staging data execution, if you save the result set as a CSV, you might want to uncheck the First row header. This is because the saved csv file doesn’t come with a header. If you want this checked, the first row should be the header name. Also, make sure that there is no extra space after the records you want to import.

Anyway, if you are successful, you should be able to see your transaction in Retail à Inquiries à Retail Store Transactions.

Retail sales transactions
Same process of creation of Process Group applies for this. I will already skip those, but here’s a sample select statement:
SELECT
  LINENUM,
  FORMAT(SHIPPINGDATEREQUESTED, 'MM/dd/yyyy') as SHIPPINGDATEREQUESTED,
  STORE,
  TERMINALID,
  TRANSACTIONID,
  FORMAT(BUSINESSDATE, 'MM/dd/yyyy') as BUSINESSDATE,
  COMMENT,
  COSTAMOUNT,
  CUSTACCOUNT,
  DISCAMOUNT,
  INVENTTRANSID,
  ITEMID,
  LINEWASDISCOUNTED,
  NETAMOUNT,
  NETAMOUNTINCLTAX,
  PRICE,
  QTY,
  STAFFID,
  TAXAMOUNT,
  TRANSACTIONSTATUS,
  FORMAT(TRANSDATE, 'MM/dd/yyyy') as TRANSDATE,
  UNIT,
  UNITQTY
FROM AX.RETAILTRANSACTIONSALESTRANS


Now, if you import this directly via DMF, you might encounter an issue of overwriting records. I tried this, and after Copy data to target my Infolog says, Data written to target (‘0’ records created, ‘3’ records updated). This is because of the relationship between DMFRetailTransactionSalesTransEntity and RetailTransactionSalesTrans. To fix this, I set the EDT relations to No – the related fields between the two tables are all identified anyway so you can actually do this.


If successful, you should be able to see your transaction in Retail à Inquiries à Retail store transactions à [Transaction] à Sales transaction. Know that the list of fields in DMF for Sales transaction is limited, like below, you might want to consider adding the Receipt number and Variant Id (if you are using Color, Style and Size) fields in the staging and target table 

Payment Transaction
Still the same process, here’s a sample select statement:
SELECT
  STORE,
  TERMINAL,
  TRANSACTIONID,
  AMOUNTCUR,
  AMOUNTMST,
  BUSINESSDATE,
  AMOUNTTENDERED,
  EXCHRATE,
  EXCHRATEMST,
  LINENUM,
  QTY,
  SHIFT,
  SHIFTDATE,
  STAFF,
  TENDERTYPE,
  TRANSACTIONSTATUS,
  TRANSDATE
FROM AX.RETAILTRANSACTIONPAYMENTTRANS


You might encounter an overwriting issue related to the relationship between DMFRetailTransPaymentTransEntity and RetailTransactionPaymentTrans, same thing should be done for the DMF table, set the EDTRelation to No.


If successful on the importation, you should be able to see your payment transaction in Retail à Inquiries à Retail store transactions à [Transaction] à Payment transaction. Know that the list of fields in DMF for Payment transaction is limited, like below, you might want to consider adding the Card details as a customization.


If you would like to download the sample text files for DMF, it’s available here. This contains sample data as well, just be mindful of the transaction number as it might already exist in your environment.


Hope this helps!


KR, Lyka

Comments

  1. Thanks a lot for that information. epos That was a really Intresting post and I would really like to know more.

    ReplyDelete
  2. This is very interesting post.
    epos
    i am impressed.

    ReplyDelete
  3. Thanks for sharing such unique restaurant epos systems uk information which are in actual fact as well as helpful for us.Keep it up.....

    ReplyDelete
  4. Here is the investors contact Email details,_   lfdsloans@lemeridianfds.com  Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Le_Meridian put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.

    ReplyDelete

Post a Comment

Popular posts from this blog

Opening RPF Files

In Dynamics AX 2012, we have this concept of pushing and pulling the data for Retail between Head Office and Store. The data is written in XML form, compressed into an rpf file then saved to a working folder.  These rpf files or data packages can be opened using DDPackView.exe which is available if you install Async Server (Head Office) or Async Client (Store). You may find it in: C:\Program Files (x86)\Microsoft Dynamics AX\60\CDX\Async Server\Package If you execute it from here, you will need to specify the actual rpf file you want to check and click Convert . You might encounter an error: Could not load file or assembly 'Microsoft.Dynamics.Retail.StoreConnect.RequestHandlerManager, Version=6.3.0.0, Cuture=neutral, PublicKeyToken=xxxx or one of its dependencies. The system cannot find the file specified. Usually, I just copy the following in the same folder of DDPackView: DDPackView.exe.config Microsoft.Dynamics.Retail.EventTraceProvider.dll Microsoft

Synchronizing Retail Transactions from Store to Dynamics AX

Hi, In my previous post, I have discussed about the details of downloading data from Head Office to Retail Store. Today, let’s discuss the process of synchronizing transactions from Retail Stores to Head Office. In a hindsight, the Async Client service in store is responsible in creating the RPF files and saving it in the Upload File Path Working folder . The RPF files of the retail transactions are created every interval as specified in the Async Client Configuration . Running the P-Job is unnecessary to create the RPF files, what we need is a secure connection between Async Client and Async Server every upload interval. Basically, the P-Job is for importing the transactions from the Upload Working Folder to Dynamics AX. So how does the Async Client know which record to include in every creation of RPF files? In AX 2012 R3, the Channel Database is maintaining the table called crt.TABLEREPLICATIONLOG . This table contains the following field: FIEL