Tuesday 25 September 2018

How to Change Retail Store Name HQ and Store

Scenario :-  If you want to change your Retail Channel Store Number which is already running with different  Number.

Steps:-  Go to the Retail - Common -Retail Channels--Retail Stores Right Click on Store Number Go to the Record Info Click on Rename , this process will take time to rename in all the transaction but in only HQ (AX).


Change Name in Store Database run below query into the SQL

AX-- In case sync data from store to HQ after Rename

delete from  RETAILTRANSACTIONTAXTRANSGTE where storeid='AFCOURT' and transactionid in
(select transactionid from RETAILTRANSACTIONSALESTRANS where store='AFCOURT' and transdate='2018/08/24')

delete from RETAILTRANSACTIONINFOCODETRANS where store='AFCOURT' and transdate='2018/08/24'
delete from RETAILTRANSACTIONPAYMENTTRANS where store='AFCOURT'  and transdate='2018/08/24'
delete from  RETAILTRANSACTIONSALESTRANS  where store ='AFCOURT' and transdate='2018/08/24'
delete from RETAILTRANSACTIONTABLE where store='AFCOURT' and transdate='2018/08/24'

POS 
update RETAILTRANSACTIONSALESTRANS set store='011' where store='AFCOURT' and transdate='2018/08/24'
update RETAILTRANSACTIONTABLE set store='011' where store='AFCOURT' and transdate='2018/08/24'
update RETAILTRANSACTIONINFOCODETRANS set store='011' where store='AFCOURT' and transdate='2018/08/24'

update RETAILTRANSACTIONTAXTRANSGTE set storeid='011' where transactionid in (
select transactionid from  RETAILTRANSACTIONTAXTRANSGTE   where  transactionid
in (select transactionid from RETAILTRANSACTIONSALESTRANS where store='011' and transdate='2018/08/24'))

or Create Procedure

USE [ProdDynamicsAX]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[RCT_RetailStoreNameChange] (@transdate as datetime) as

update [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONSALESTRANS set store='011' where store='AFCOURT' and transdate= @transdate
update [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONTABLE set store='011' where store='AFCOURT' and transdate= @transdate
update [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONINFOCODETRANS set store='011' where store='AFCOURT' and transdate= @transdate

update [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONTAXTRANSGTE set storeid='011' where transactionid in (
select transactionid from  [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONTAXTRANSGTE   where  transactionid 
in (select transactionid from [192.168.2.55].PRODFCT011.ax.RETAILTRANSACTIONSALESTRANS where store='011' and transdate=@transdate))

delete from  RETAILTRANSACTIONTAXTRANSGTE where storeid='AFCOURT' and transactionid in 
 (select transactionid from RETAILTRANSACTIONSALESTRANS where store='AFCOURT' and transdate=@transdate)

delete from RETAILTRANSACTIONINFOCODETRANS where store='AFCOURT' and transdate=@transdate
delete from RETAILTRANSACTIONPAYMENTTRANS where store='AFCOURT'  and transdate=@transdate
delete from  RETAILTRANSACTIONSALESTRANS  where store ='AFCOURT' and transdate=@transdate
delete from RETAILTRANSACTIONTABLE where store='AFCOURT' and transdate= @transdate



1 comment: