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



Thursday, 20 September 2018

Retail Statement Calculating/Posting Error " Unknown Or Incorrectly selected return lot."

Problem :- Retail Statement Calculating/Posting Error " Unknown or incorrectly Selected return lot "


Cause :- This problem comes due to partial statement posting or got disconnect while calculating statement.

Solution:- Remove ReturnTransactionId from RetailTransactionSalesTrans, After Calculating and Posting ,again you have to update that ReturnTransactionId into RetailTransactionSalesTrans with same record.

SQL Query :- Below query you have to run on your HQ database

1.  Select Returntransactionid,* From Retailtransactionsalestrans Where Itemid='1242A9991000018' And Dataareaid='1006' and STATEMENTID ='002-000376'

  1. Update Retailtransactionsalestrans Set Returntransactionid='' Where Itemid='1242A9991000018' And Dataareaid='1006' And Receiptid='00910420000017' and STATEMENTID ='002-000376'
  1. Update Retailtransactionsalestrans Set Returntransactionid='009-T-087-11926' Where Itemid='1242A9991000018' And Dataareaid='1006' And Receiptid='00910420000017' and STATEMENTID ='002-000376'

Friday, 14 September 2018

The Quantity Being Returned is greater than what can be covered by the return lot

Problem :- Facing Error at the time of calculating Retail Statement "The Quantity Being Returned is greater than what can be covered by the return lot."


Solution :- Comment Image code then calculate the statement. 

How To Delete and Re Post Retail Statement

Problem :- Getting retail statement calculation error "Insufficient Inventory Transactions With Status On Order,Reserved Ordered Reserved Physical And Picked."


Cause :- this error comes due to partial calculation or partial posted statement.

Solution:- Run below procedure into the HQ database, then clear the statement and again calculate statement.

USE [ProdDynamicsAX]
GO
/****** Object:  StoredProcedure [dbo].[RCT_ReverseStatement]    Script Date: 09-10-2018 07:37:39 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create Procedure [dbo].[ReverseStatement] (@dataareaid  nvarchar(50),@stmtid nvarchar(50), @storeid nvarchar(50) )as

--declare @dataareaid  nvarchar(50)
--set @dataareaid='1001'
--declare @stmtid   nvarchar(50)
--set @stmtid='AFCOURT-000051'
--declare  @storeid   nvarchar(50) 
--set @storeid = '011'


update retailtransactiontable set SALESORDERID = '' where statementid = @stmtid and type = 2 and store = @storeid and recid in 
(select recid from retailtransactiontable where statementid = @stmtid and type = 2 and store = @storeid  )

update RETAILSTATEMENTTABLE set POSTINGDATE = '' where STATEMENTID = @stmtid and recid in 
(select recid from RETAILSTATEMENTTABLE  where STATEMENTID = @stmtid )

UPDATE RETAILTRANSACTIONTABLE SET STATEMENTID ='', ENTRYSTATUS = 0,SALESORDERID = '',INVOICEID = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND ENTRYSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONTABLE where  DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND ENTRYSTATUS not in (1,3) )

UPDATE RETAILTRANSACTIONTABLE SET STATEMENTID ='', SALESORDERID = '',INVOICEID = '' 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND ENTRYSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONTABLE where  DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND ENTRYSTATUS in (1,3) )


UPDATE RETAILTRANSACTIONSALESTRANS SET STATEMENTID ='', INVENTTRANSID = '', TRANSACTIONSTATUS = 0, INVENTSTATUSSALES = 0,COSTAMOUNT = 0, INVENTDIMID = '' 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONSALESTRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) )

UPDATE RETAILTRANSACTIONSALESTRANS SET STATEMENTID ='', INVENTTRANSID = '', INVENTSTATUSSALES = 0, COSTAMOUNT = 0, INVENTDIMID = '' 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONSALESTRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3))


UPDATE RETAILTRANSACTIONPAYMENTTRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0,STATEMENTCODE  = ''
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONPAYMENTTRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3))


UPDATE RETAILTRANSACTIONPAYMENTTRANS SET STATEMENTID = '', STATEMENTCODE  = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONPAYMENTTRANS where DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3))


UPDATE RETAILTRANSACTIONBANKEDTENDERTRANS SET STATEMENTID = '',TRANSACTIONSTATUS = 0 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONBANKEDTENDERTRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid)
 AND TRANSACTIONSTATUS not in (1,3))


UPDATE RETAILTRANSACTIONBANKEDTENDERTRANS SET STATEMENTID = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONBANKEDTENDERTRANS where  DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3))


UPDATE RETAILTRANSACTIONSAFETENDERTRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONSAFETENDERTRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid)
 AND TRANSACTIONSTATUS not in (1,3))

UPDATE RETAILTRANSACTIONSAFETENDERTRANS SET STATEMENTID = '' WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) 
AND TRANSACTIONSTATUS in (1,3)
and recid in (select recid from  RETAILTRANSACTIONSAFETENDERTRANS where  DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid)
AND TRANSACTIONSTATUS in (1,3))

UPDATE RETAILTRANSACTIONINCOMEEXPENSETRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0 
WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONINCOMEEXPENSETRANS where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) 
AND TRANSACTIONSTATUS not in (1,3) )


UPDATE RETAILTRANSACTIONINCOMEEXPENSETRANS SET STATEMENTID = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONINCOMEEXPENSETRANS WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) )

UPDATE RETAILTRANSACTIONORDERINVOICETRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0 WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONORDERINVOICETRANS where  DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) )

UPDATE RETAILTRANSACTIONORDERINVOICETRANS SET STATEMENTID = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONORDERINVOICETRANS WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) )

UPDATE RETAILTRANSACTIONINFOCODETRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0 WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in 
(select recid from RETAILTRANSACTIONINFOCODETRANS where DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) )

UPDATE RETAILTRANSACTIONINFOCODETRANS SET STATEMENTID = '' WHERE DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
(select recid from RETAILTRANSACTIONINFOCODETRANS where DATAAREAID = @dataareaid 
AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) )

UPDATE RETAILTRANSACTIONTENDERDECLARATIONTRANS SET STATEMENTID = '', TRANSACTIONSTATUS = 0, 
StatementCode = '' WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS not in (1,3) and recid in
(select recid from RETAILTRANSACTIONTENDERDECLARATIONTRANS where  DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid)
 AND TRANSACTIONSTATUS not in (1,3))

UPDATE RETAILTRANSACTIONTENDERDECLARATIONTRANS SET STATEMENTID = '', StatementCode = '' WHERE
 DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3) and recid in 
 (select recid from RETAILTRANSACTIONTENDERDECLARATIONTRANS where  DATAAREAID = @dataareaid AND 
 STATEMENTID in (@stmtid) AND TRANSACTIONSTATUS in (1,3))

DELETE RETAILSTATEMENTJOUR WHERE DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) and recid in 
(select recid from RETAILSTATEMENTJOUR where DATAAREAID = @dataareaid AND STATEMENTID in (@stmtid) )

DELETE RETAILSTATEMENTTRANS WHERE DATAAREAID = @dataareaid AND  STATEMENTID in (@stmtid) and recid in
(select recid from RETAILSTATEMENTTRANS where  DATAAREAID = @dataareaid AND  STATEMENTID in (@stmtid))

Delete RETAILSTATEMENTVOUCHER where STATEMENTID in (@stmtid) and recid in 
(select recid from RETAILSTATEMENTVOUCHER  where STATEMENTID in (@stmtid))

Exec Reversestatement '1001','afcourt-000037','011'



Wednesday, 22 August 2018

Temp Cleaner with desktop backup Batch Jobs

Temp Cleaner with desktop backup
-----------------------------------------------Mr. Cleaner--------------------------------------
cls
@echo off
:: BatchGotAdmin
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"

netsh interface set interface name="Ethernet" admin=DISABLE
netsh interface set interface name="Ethernet 2" admin=DISABLE
netsh interface set interface name="Ethernet 3" admin=DISABLE
netsh interface set interface name="Ethernet 4" admin=DISABLE
netsh interface set interface name="Ethernet 5" admin=DISABLE
netsh interface set interface name="Ethernet 6" admin=DISABLE
netsh interface set interface name="Ethernet 7" admin=DISABLE
netsh interface set interface name="Ethernet 8" admin=DISABLE
netsh interface set interface name="Ethernet 9" admin=DISABLE
netsh interface set interface name="Ethernet 10" admin=DISABLE
netsh interface set interface name="Ethernet 11" admin=DISABLE
netsh interface set interface name="Ethernet 12" admin=DISABLE
netsh interface set interface name="Ethernet 13" admin=DISABLE
netsh interface set interface name="Ethernet 14" admin=DISABLE
netsh interface set interface name="Ethernet 15" admin=DISABLE
netsh interface set interface name="Ethernet 16" admin=DISABLE
netsh interface set interface name="Ethernet 17" admin=DISABLE
netsh interface set interface name="Ethernet 18" admin=DISABLE
netsh interface set interface name="Ethernet 19" admin=DISABLE
netsh interface set interface name="Ethernet 20" admin=DISABLE
netsh interface set interface name="Ethernet 21" admin=DISABLE
netsh interface set interface name="Wi-Fi" admin=DISABLE
netsh interface set interface name="Wi-Fi 2" admin=DISABLE
netsh interface set interface name="Wi-Fi 3" admin=DISABLE
netsh interface set interface name="Wi-Fi 4" admin=DISABLE
netsh interface set interface name="Wi-Fi 5" admin=DISABLE
netsh interface set interface name="Wi-Fi 6" admin=DISABLE
netsh interface set interface name="Wi-Fi 7" admin=DISABLE
netsh interface set interface name="Wi-Fi 8" admin=DISABLE
netsh interface set interface name="Wi-Fi 9" admin=DISABLE
netsh interface set interface name="Wi-Fi 10" admin=DISABLE
netsh interface set interface name="Wi-Fi 11" admin=DISABLE
netsh interface set interface name="Wi-Fi 12" admin=DISABLE
netsh interface set interface name="Wi-Fi 13" admin=DISABLE
netsh interface set interface name="Wi-Fi 14" admin=DISABLE
netsh interface set interface name="Wi-Fi 15" admin=DISABLE
netsh interface set interface name="Wi-Fi 16" admin=DISABLE
netsh interface set interface name="Wi-Fi 17" admin=DISABLE
netsh interface set interface name="Wi-Fi 18" admin=DISABLE
netsh interface set interface name="Wi-Fi 19" admin=DISABLE
netsh interface set interface name="Wi-Fi 20" admin=DISABLE
netsh interface set interface name="Wi-Fi 21" admin=DISABLE
ipconfig/flushDNS
taskkill.exe /f /fi "status eq not responding"
w32tm /query /peers
sc config w32time start= auto
w32tm /config /syncfromflags:manual /manualpeerlist:"0.us.pool.ntp.org,1.us.pool.ntp.org,2.us.pool.ntp.org,3.us.pool.ntp.org"
w32tm /config /reliable:yes
net stop w32time
net start w32time
w32tm /resync /nowait
net stop spooler
cls
Del /S "%LOCALAPPDATA%\*.auc " /q
Del /s "%LOCALAPPDATA%\temp\*.*" /q
Del /s /q %systemdrive%\$Recycle.bin
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\*
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\*
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\CustomDestinations\*
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop" /V FFLAGS /T REG_DWORD /D 1075839521 /F
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data
del /q /s /f "%ChromeDir%"
rd /s /q "%ChromeDir%"
set DataDir=C:\Users\%USERNAME%\AppData\Local\Mozilla\Firefox\Profiles
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
for /d %%x in (C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles\*) do del /q /s /f %%x\*sqlite
set DataDir=C:\Users\%USERNAME%\AppData\Local\Opera\Opera
set DataDir2=C:\Users\%USERNAME%\AppData\Roaming\Opera\Opera
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
del /q /s /f "%DataDir2%"
rd /s /q "%DataDir2%"
set DataDir=C:\Users\%USERNAME%\AppData\Local\Microsoft\Intern~1
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
set History=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\History
del /q /s /f "%History%"
rd /s /q "%History%"
set IETemp=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Tempor~1
del /q /s /f "%IETemp%"
rd /s /q "%IETemp%"
set Cookies=C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Cookies
del /q /s /f "%Cookies%"
rd /s /q "%Cookies%"
C:\bin\regdelete.exe HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\TypedURLs"
set FlashCookies=C:\Users\%USERNAME%\AppData\Roaming\Macromedia\Flashp~1
del /q /s /f "%FlashCookies%"
rd /s /q "%FlashCookies%"
set curr_date=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%
mkdir "%USERPROFILE%\My Documents\Backup\%curr_date%_backup"
xcopy "%USERPROFILE%\Desktop" "%USERPROFILE%\My Documents\Backup\%curr_date%_backup" /D/S/H/V/C/F/K/Y
for /d /r "%USERPROFILE%\Desktop" %%x in (*) do rd /s /q "%%x"
for /r "%USERPROFILE%\Desktop" %%x in (*) do del /f "%%x"
copy "%USERPROFILE%\My Documents\Backup\%curr_date%_backup\*.lnk" "%USERPROFILE%\Desktop\"
del /q "%USERPROFILE%\My Documents\Backup\%curr_date%_backup\*.lnk"
rd /q /s c:\$Recycle.Bin
rd /q /s d:\$Recycle.Bin
rd /q /s e:\$Recycle.Bin
rd /q /s f:\$Recycle.Bin
rd /q /s g:\$Recycle.Bin
rd /q /s h:\$Recycle.Bin
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop" /V FFLAGS /T REG_DWORD /D 1075839521 /F
taskkill /f /im explorer.exe
start explorer.exe
mrt.exe
netsh interface set interface name="Ethernet" admin=ENABLE
netsh interface set interface name="Ethernet 2" admin=ENABLE
netsh interface set interface name="Ethernet 3" admin=ENABLE
netsh interface set interface name="Ethernet 4" admin=ENABLE
netsh interface set interface name="Ethernet 5" admin=ENABLE
netsh interface set interface name="Ethernet 6" admin=ENABLE
netsh interface set interface name="Ethernet 7" admin=ENABLE
netsh interface set interface name="Ethernet 8" admin=ENABLE
netsh interface set interface name="Ethernet 9" admin=ENABLE
netsh interface set interface name="Ethernet 10" admin=ENABLE
netsh interface set interface name="Ethernet 11" admin=ENABLE
netsh interface set interface name="Ethernet 12" admin=ENABLE
netsh interface set interface name="Ethernet 13" admin=ENABLE
netsh interface set interface name="Ethernet 14" admin=ENABLE
netsh interface set interface name="Ethernet 15" admin=ENABLE
netsh interface set interface name="Ethernet 16" admin=ENABLE
netsh interface set interface name="Ethernet 17" admin=ENABLE
netsh interface set interface name="Ethernet 18" admin=ENABLE
netsh interface set interface name="Ethernet 19" admin=ENABLE
netsh interface set interface name="Ethernet 20" admin=ENABLE
netsh interface set interface name="Ethernet 21" admin=ENABLE
netsh interface set interface name="Wi-Fi" admin=ENABLE
netsh interface set interface name="Wi-Fi 2" admin=ENABLE
netsh interface set interface name="Wi-Fi 3" admin=ENABLE
netsh interface set interface name="Wi-Fi 4" admin=ENABLE
netsh interface set interface name="Wi-Fi 5" admin=ENABLE
netsh interface set interface name="Wi-Fi 6" admin=ENABLE
netsh interface set interface name="Wi-Fi 7" admin=ENABLE
netsh interface set interface name="Wi-Fi 8" admin=ENABLE
netsh interface set interface name="Wi-Fi 9" admin=ENABLE
netsh interface set interface name="Wi-Fi 10" admin=ENABLE
netsh interface set interface name="Wi-Fi 11" admin=ENABLE
netsh interface set interface name="Wi-Fi 12" admin=ENABLE
netsh interface set interface name="Wi-Fi 13" admin=ENABLE
netsh interface set interface name="Wi-Fi 14" admin=ENABLE
netsh interface set interface name="Wi-Fi 15" admin=ENABLE
netsh interface set interface name="Wi-Fi 16" admin=ENABLE
netsh interface set interface name="Wi-Fi 17" admin=ENABLE
netsh interface set interface name="Wi-Fi 18" admin=ENABLE
netsh interface set interface name="Wi-Fi 19" admin=ENABLE
netsh interface set interface name="Wi-Fi 20" admin=ENABLE
netsh interface set interface name="Wi-Fi 21" admin=ENABLE
cls
net start spooler
Cleanmgr
cls
defrag D:
defrag C:
sfc /scannow
Fsutil behavior query memoryusage
Fsutil behavior set memoryusage 2
shutdown -r
exit

-------------------------------------------------XXXX--------------------------------------------------

How to create batch job to register self signed certificate in local machine, below query save into your batch file as per your path.

------------------------------------Register Certificate-------------------------------------------------
cd\
cls
@echo off
:: BatchGotAdmin
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
md C:\Prod_Certificate
cd Windows\system32
Robocopy \\192.168.2.52\POS_Installation_Setup\Certificate\ C:\Prod_Certificate\
certutil -p a -importpfx root C:\Prod_Certificate\Prod_Certificate.pfx
---------------------------------------------xxxxxxxxxxxxxxxxxxxxx--------------------------------------

How to create batch job to stop and restart services of local machine, below query save into your batch file as per your path
-----------------------------------------------Mange Services------------------------------------------------
cd\
cls
@echo off
:: BatchGotAdmin
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
cd Windows\system32
net stop "CommerceDataExchangeAsyncClientService"
net stop "CommerceDataExchangeAsyncClientService_SPM001"
net stop "CommerceDataExchangeAsyncClientService_FST002"
net stop "CommerceDataExchangeAsyncClientService_RS1003"
net stop "CommerceDataExchangeAsyncClientService_RS7004"
net stop "CommerceDataExchangeAsyncClientService_SRT005"
net stop "CommerceDataExchangeAsyncClientService_SRG006"
net stop "CommerceDataExchangeAsyncClientService_SRE007"
net stop "CommerceDataExchangeAsyncClientService_SMC008"
net stop "CommerceDataExchangeAsyncClientService_RCT009"
net stop "CommerceDataExchangeAsyncClientService_JYT010"
net stop "Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe"
net stop "Microsoft Dynamics AX Commerce Data Exchange: Real-time Service 5.1"
net stop "Microsoft Dynamics AX Commerce Data Exchange: Real-time Service 6.1"
net stop "CommerceDataExchangeAsyncClientService"
net stop "CommerceDataExchangeAsyncClientService_RCTS1"
net stop "CommerceDataExchangeAsyncClientService_RCTS7"
net stop "AOS60$02"
net stop "MSSQLSERVER"
net start "MSSQLSERVER"
net stop "SSASTELEMETRY"
net stop "MSSQLServerOLAPService"
net stop "ReportServer"
net start "AOS60$02"
net start "CommerceDataExchangeAsyncClientService"
net start "CommerceDataExchangeAsyncClientService_SPM001"
net start "CommerceDataExchangeAsyncClientService_RCTS1"
net start "CommerceDataExchangeAsyncClientService_RCTS7"
net start "CommerceDataExchangeAsyncClientService_FST002"
net start "CommerceDataExchangeAsyncClientService_RS1003"
net start "CommerceDataExchangeAsyncClientService_RS7004"
net start "CommerceDataExchangeAsyncClientService_SRT005"
net start "CommerceDataExchangeAsyncClientService_SRG006"
net start "CommerceDataExchangeAsyncClientService_SRE007"
net start "CommerceDataExchangeAsyncClientService_SMC008"
net start "CommerceDataExchangeAsyncClientService_RCT009"
net start "CommerceDataExchangeAsyncClientService_JYT010"
net start "Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe"
net start "Microsoft Dynamics AX Commerce Data Exchange: Real-time Service 5.1"
net start "Microsoft Dynamics AX Commerce Data Exchange: Real-time Service 6.1"
cls
exit
----------------------------------------xxxxxxxxxxxxxx-----------------------------------------------
How to create batch job to remove temp files from your local machine, below query save into your batch file as per your path


----------------------------------------------Temp Cleaner---------------------------------------------
cls
@echo off
:: BatchGotAdmin

REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"

ipconfig/flushDNS
cls
Del /S "%LOCALAPPDATA%\*.auc " /q
Del /s "%LOCALAPPDATA%\temp\*.*" /q
Del /s /q %systemdrive%\$Recycle.bin
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\*
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\*
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\CustomDestinations\*
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop" /V FFLAGS /T REG_DWORD /D 1075839521 /F
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data
del /q /s /f "%ChromeDir%"
rd /s /q "%ChromeDir%"
set DataDir=C:\Users\%USERNAME%\AppData\Local\Mozilla\Firefox\Profiles
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
for /d %%x in (C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles\*) do del /q /s /f %%x\*sqlite
set DataDir=C:\Users\%USERNAME%\AppData\Local\Opera\Opera
set DataDir2=C:\Users\%USERNAME%\AppData\Roaming\Opera\Opera
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
del /q /s /f "%DataDir2%"
rd /s /q "%DataDir2%"
set DataDir=C:\Users\%USERNAME%\AppData\Local\Microsoft\Intern~1
del /q /s /f "%DataDir%"
rd /s /q "%DataDir%"
set History=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\History
del /q /s /f "%History%"
rd /s /q "%History%"
set IETemp=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Tempor~1
del /q /s /f "%IETemp%"
rd /s /q "%IETemp%"
set Cookies=C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Cookies
del /q /s /f "%Cookies%"
rd /s /q "%Cookies%"
C:\bin\regdelete.exe HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\TypedURLs"
set FlashCookies=C:\Users\%USERNAME%\AppData\Roaming\Macromedia\Flashp~1
del /q /s /f "%FlashCookies%"
rd /s /q "%FlashCookies%"
cd windows
cd system32
cls
exit
------------------------------------------------------------xxxxxxxxxxx--------------------------------------------



POS Error Customer Payment Method Has Not Been Setup

Problem:-
Error on POS, while using 'Customer Account Payment'"Customer Payment method has not been setup" this issue is appearing on few customers, while rest of transactions with account payments are working fine

Solution :-
Run Below Query into your AX Database against that customer

Select * from RETAILCUSTTABLE where accountnum='CUS0433'
Update RETAILCUSTTABLE set  NONCHARGABLEACCOUNT='0' where accountnum='CUS0433'
--- Then Run customer job to replicate the data to store ---

Clear Statement and Calculate Statement Buttons Disable in Retail Statement

If you are stuck in previously Calculated Statement, in ribbon tab showing Clear Statement and Calculate Statement Buttons Disabled as below











Resons:- When a statement posting fails, the expectation would be that the statement postings are rolled back and the statement returns to its original calculated state.  What is actually occurring is that the statement stops where it is and doesn’t completely roll back.
Some of those Sales Orders may have already been created and are still linked to the statements transactions. 

Solution :- Run Below Query into the AX database into the SQL 

select POSTINGDATE, * from RETAILSTATEMENTTABLE where STATEMENTID = '002-000009'
update RETAILSTATEMENTTABLE set POSTINGDATE = '' where STATEMENTID = '002-000009'