The user testing environment on a Microsoft-managed tier-2 environment was recently upgraded to 10.0.12 (10.0.507.30031), Same version as 1 of my cloud-hosted development environments. The backup of UAT that I had before on my Dev environment works fine. But to get more up to date data for debugging I exported the database from UAT and imported it into my Dev environment.
I ran the provisioning tool against the Dev environment..
I ran the initialize commerce scheduler with YES to remove setup.
I went to the Commerce Shared Parameters and created an entry for my Dev environment retail server under the Identity providers.
I then made sure the 'DefaultChannelDatabase batch' has the status of Waiting and then I ran the distribution scheduler for all jobs (job 9999). I also ran the Full db Sync on the channel database for job '9999'. I waited until the jobs under the Download Sessions showed status applied.
I then opened the CloudPOS solution in VS 2017 and built it and then ran it. It needs to activate my device and I get a Database error has occurred. It indicated that step 1 of 8 failed due to a number sequence.
I then looked in the eventViewer and see the following error:
"at Microsoft.Dynamics.Commerce.Runtime.DataServices.SqlServer.ChannelSqlServerDataService.GetReceiptNumberResetInfoByFunctionalityProfileId(GetReceiptNumberResetInfoRequest request)
"
The eventViewer also tells me that crt.RECEIPTNUMBERRESETINFOVIEW is an unknown object.
I then looked in SSMS and I could not find the view crt.RECEIPTNUMBERRESETINFOVIEW. I looked in another Dev box that we have that is still on Version: 10.0.12 (10.0.507.20026) and the view is in SSMS under AxDB. I then logged onto the RDP of UAT and looked in SSMS and the view doesn't exist there. Now it can either be because on the tier-2 environment the channel DB is on another server because we make use of cloud hosted scale units. But on the Dev box the channel DB is the "default" DB which is in SSMS together with D365.
I have done everything I usually do when I refresh the database on my Dev environment and never had this problem. I did ran a synchronize database in VS 2017 and I build my custom model under the Dynamics 365 tab in VS.
I even ran the Commerce channel schema for AX7 this time and choose to generate the queries and it still didn't put the missing view in AxDB.
I then applied the provision tool again against my Dev environment and this time when I want to run CloudPOS from within VS 2017, I get the following error in the eventViewer:
"
Exception: Microsoft.Dynamics.Commerce.Runtime.StorageException: Failed to read from the database. See inner exception for details
DatabaseErrorCode: 0 ---> Microsoft.Dynamics.Commerce.Runtime.Data.DatabaseException: Database error 'Unknown' occurred for 'execute stored procedure '[crt].GETVISUALPROFILE''. Could not find stored procedure 'crt.GETVISUALPROFILE'. ---> System.Data.SqlClient.SqlException: Could not find stored procedure 'crt.GETVISUALPROFILE'.
"
So I ran the initialize commerce scheduler and the channel database full DB sync again. After the download sessions showed applied, I built the CloudPOS solution in Vs 2017 again and ran it again.. I still get the databsae error occured and looking in eventViewer, it shows again the error that the stored procedure crt.GETVISUALPROFILE is missing.
There is 2 things that I did notice with this refresh is that 'DefaultChannelDatabase batch' used to be under batch jobs for company DAT only. Now there shows 2, one for DAT and one for our company. I changed both to have status "Waiting" instead of Withhold.
Also, the channel database group used to have only the option "Default". It now has the option "Default" and "Legacy". It defaulted "Legacy" and I changed it to "Default" . Could this be the problem, should I have left it as ""Legacy". Is it controlled by some feature that was turned on in UAT and now is turned on in my Dev environment too but because I switched the channel database group to "Default" instead of leaving it on "Legacy", maybe that is the reason the view is missing?
So what changed between the v10.0.12 hotfix 20026 and 30031. It clearly doesn't create the channel databse correctly