October 05, 2020

QuickFix -15:[Solved] Error The data value violates integrity constraints.

Getting below error while importing a file using the Data management framework. 

Issue: 

"The data value violates integrity constraints"

Possible solution: 

Check two things primarily. 

1. If any mandatory fields are blank in file

2. Set if a unique filed contain duplicate values in file.


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

September 17, 2020

[Solved] D365FO logic app connector error: Failed with error: 'The browser is closed.'. Please sign in again.


Hi Folks,

I hope all of us keep themself safe during this tough time and utilizing this to learn something new and enhance your skill sets. 

With that note, let me share one of my findings with the Logic Apps issue. I was trying to sign in D365FO connector and getting below error

Failed with error: 'The browser is closed.'. Please sign in again or choose another connection.



Well, there can be many solutions to it, try the below steps, 

1. Check the user is available in the respective D365FO environment with proper access. 
2. Check if there are any API created during one of the tries, and delete it.
3. Clear browser cookies. 
4. Try ti use Edge than other browsers.

Also, if you are working with multiple domains, I mean your azure portal is on a different domain and D365FO is on a different domain try below, 

When you login into https://portal.azure.com/ uncheck below checkbox, and click, 'No'.


Now when you must be able to sign in D365FO connector with other domain without any issue. 

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

September 04, 2020

QuickFix -14:[Solved] Error "error occurred while doing bulk copy from temp table to entity table"

While importing a file using Data entity getting below error, 

 Error message:

"Error occurred while doing bulk copy from temptable to entity table- '0' '<Entity Name>' record(s) inserted in staging"

Solution

Normally this error comes when there are issues with data. Check your input file look for field values that are part of the primary key. There must be some duplicate value where the system is throwing the above error. 

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

August 10, 2020

How to Import Tier 1 box Data backup to Tier 2 Box

Hi Folks,  

All tier 2 server we have to use bacpac file to restore a database from tier 1 server which has .bak file when doing a DB export. In this post, we will see how to restore the database from tier 1 server to tier 2 server.

(Know more about Cloud offering and different tiers)

Step 1: Create a copy of your DB.

Use below script,

BACKUP DATABASE [AxDB] TO DISK = N'D:\Backups\axdb_golden.bak' WITH NOFORMAT, NOINIT,

NAME = N'AxDB_golden-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10

GO

RESTORE DATABASE [AxDB_CopyForExport] FROM DISK = N'D:\Backups\axdb_golden.bak' WITH FILE = 1,

MOVE N'AXDBBuild_Data' TO N'F:\MSSQL_DATA\AxDB_CopyForExport.mdf',

MOVE N'AXDBBuild_Log' TO N'G:\MSSQL_LOGS\AxDB_CopyForExport_Log.ldf',

NOUNLOAD, STATS = 5

 

Choose master from the dropdown, so the new DB will create on the root folder on inside the AXDB. Make sure you update all the paths as per your machine. This script must create a new database named AxDB_CopyForExport.

 


Step 2: Now we need to make some changes in this Database. You should run this script for a successful Export/Import of database.

 Here is the complete script, which you need to run on new DB i.e. AxDB_CopyForExport .

update sysglobalconfiguration

set value = 'SQLAZURE'

where name = 'BACKENDDB'

update sysglobalconfiguration

set value = 1

where name = 'TEMPTABLEINAXDB'

drop procedure if exists XU_DisableEnableNonClusteredIndexes

drop procedure if exists SP_ConfigureTablesForChangeTracking

drop procedure if exists SP_ConfigureTablesForChangeTracking_V2

drop schema [NT AUTHORITY\NETWORK SERVICE]

drop user [NT AUTHORITY\NETWORK SERVICE]

drop user axdbadmin

drop user axdeployuser

drop user axmrruntimeuser

drop user axretaildatasyncuser

drop user axretailruntimeuser

drop user axdeployextuser

 

--Tidy up the batch server config from the previous environment

DELETE FROM SYSSERVERCONFIG

 

--Tidy up server sessions from the previous environment

DELETE FROM SYSSERVERSESSIONS

 

--Tidy up printers from the previous environment

DELETE FROM SYSCORPNETPRINTERS

 

--Tidy up client sessions from the previous environment

DELETE FROM SYSCLIENTSESSIONS

 

--Tidy up batch sessions from the previous environment

DELETE FROM BATCHSERVERCONFIG

 

--Tidy up batch server to batch group relation table

DELETE FROM BATCHSERVERGROUP

 

-- Clear encrypted hardware profile merchant properties

update dbo.RETAILHARDWAREPROFILE set SECUREMERCHANTPROPERTIES = null where SECUREMERCHANTPROPERTIES is not null

 Above scrip will; 

I. Set the SysGlobalConfiguration flag to inform the application that the database is Azure-based.

II. Remove a reference to tempDB in the XU_DisableEnableNonClusteredIndexes procedure. References to tempDB aren't allowed in an Azure SQL database. The database synchronization process will re-create the reference later.

III. Drop users, because Microsoft Windows users are forbidden in Azure SQL databases. Other users must be re-created later so that they're correctly linked to the appropriate sign-in on the target server.

IV. Clear encrypted hardware profile merchant properties.

Step 3: Export database as bacpac file.

Open CMD as admin (it will work without cmd as well), and go to path “C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\”

Run below command,

SqlPackage.exe /a:export /ssn:localhost /sdn: AxDB_CopyForExport /tf: J:\MSSQL_BACKUP\GoldenConfig01082020.bacpac /p:CommandTimeout=1200 /p:VerifyFullTextDocumentTypesSupported=false

·         \ ssn (source server name) – The name of the SQL Server to export from. For the purposes of this topic, the name should always be localhost.

·         sdn (source database name) – The name of the database to export.

·         tf (target file) – The path and name of the file to export to. The folder should already exist, but the export the process will create the file.

 

Check all the default location carefully and run it. Don’t put any space while putting these values, (refer below image) else it will throw an error


Step 4: Upload bacpac file to LCS

Login into lcs.dynamics.com and Go to assets library > database  backup > click on + button

Select your file and select the backup type as ‘Product database (SQL Server or .bak)’ and upload this file.

Step 5: Import database to target tier 2 box.

Go to LCS and select a target T-2 box,

Click on details

Go to maintenance > Move database > Import a bacpac > select your file from the asset library


Further reference; Click here.

Cheers!!!

Harry