Wednesday, 2 May 2018

Transaction missed from store to ax (Upload P- Job)


Statement and Shift Report not matching with each other, this is due to Sync transaction missed retail channel database to AX Database

How to match the record Channel Database to AX Database Run below Query  Both databasese and count the record :-

select STAFFID,TRANSACTIONID,RECEIPTID,BARCODE,ITEMID from RETAILTRANSACTIONSALESTRANS where TRANSDATE='2018-07-12' and STAFFID='000566' and  RECEIPTID!=''

select STAFF,TRANSACTIONID,RECEIPTID from RETAILTRANSACTIONTABLE where TRANSDATE='2018-07-12' and STAFF='000566' and RECEIPTID!='' order by RECEIPTID


This Problem comes due to mismatch Region/Date/Time Zone 

1.   At the Store Level Stop the Async Client Service (If You Have This Service Set to Automatically Restart on Failure Make Sure You Turn This Off In The Properties For The Service)

2.   Ensure That the POS Application Is Closed (Or At Least Not Being Using at The Time)

3.   Open SQL Server Management Studio and Connect to The SQL Server Hosting Your Channel (Store) Database

4.   Run the Following Query Against Your Channel Database DELETE FROM CRT.TABLEREPLICATIONLOG

5.   Once This Completes, Start the Async Client Service on The Machine (This Will Trigger Async Client to Check for Any Records to Upload)

6.   Either Run the Below Query Against Your Async Server Message Database, Or Check Your Upload Work Folder to Confirm A New Package File Has Been Created SELECT * FROM UPLOADSESSION ORDER BY ID DESC

7.   Once You See the New Package File, Go Into AX, And Select to Run The P-Job.  

8.   If There Are No Errors Running The P-Job, Go to Retail > Inquiries > Commerce Data Exchange > Upload Sessions 

9.   You Should See an Entry in This Form with The Column Date Uploaded Showing the Date and Time You Ran The P-Job

10.   If You See the Entry in This Form, Then Everything Worked, And You Can Create/Calculate/Post Statements for The Store.


Schedule Store Procedure to Delete Sync Transaction from Store Database :-


USE [ProdDynamicsAX]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[Admin_POS_AutoSync] as
declare @dbcount as int
declare @aoscount as int

--Store 1 SUPERMARKET
--------------------------------------------------------------------------------------
set @aoscount=0
set @dbcount=0
select @aoscount=count(*) from  dbo.RETAILTRANSACTIONSALESTRANS where convert(date,TRANSDATE,103)=
convert(date,getdate()-1,103)
and  store='001' and RECEIPTID!=''
select @dbcount=count(*) from  [192.168.2.55].ProdSPM001.ax.RETAILTRANSACTIONSALESTRANS where
convert(date,createddatetime,103)=convert(date,getdate()-1,103)

if @aoscount<>@dbcount
       delete from  [192.168.2.55].ProdSPM001.crt.tablereplicationlog

--select @aoscount
--select @dbcount

set @aoscount=0
set @dbcount=0
select @aoscount=count(*) from  dbo.RETAILTRANSACTIONTABLE where convert(date,TRANSDATE,103)=
convert(date,getdate()-1,103)
and  store='001' and RECEIPTID!=''
select @dbcount=count(*) from  [192.168.2.55].ProdSPM001.ax.RETAILTRANSACTIONTABLE where
convert(date,createddatetime,103)=convert(date,getdate()-1,103)

if @aoscount<>@dbcount
       delete from  [192.168.2.55].ProdSPM001.crt.tablereplicationlog

--select @aoscount
--select @dbcount

-------------------------------------------------------------------------------------

--Store 2
-------------------------------------------------------------------------------------
set @aoscount=0
set @dbcount=0
select @aoscount=count(*) from  dbo.RETAILTRANSACTIONSALESTRANS where convert(date,TRANSDATE,103)=
convert(date,getdate()-1,103)
and  store='002' and RECEIPTID!=''
select @dbcount=count(*) from  [192.168.2.55].ProdFST002.ax.RETAILTRANSACTIONSALESTRANS where
convert(date,createddatetime,103)=convert(date,getdate()-1,103)

if @aoscount<>@dbcount
       delete from  [192.168.2.55].ProdFST002.crt.tablereplicationlog

--select @aoscount
--select @dbcount

set @aoscount=0
set @dbcount=0
select @aoscount=count(*) from  dbo.RETAILTRANSACTIONTABLE where convert(date,TRANSDATE,103)=
convert(date,getdate()-1,103)
and  store='002' and RECEIPTID!=''
select @dbcount=count(*) from  [192.168.2.55].ProdFST002.ax.RETAILTRANSACTIONTABLE where
convert(date,createddatetime,103)=convert(date,getdate()-1,103)

if @aoscount<>@dbcount
       delete from  [192.168.2.55].ProdFST002.crt.tablereplicationlog

--select @aoscount
--select @dbcount

No comments:

Post a Comment