November 15, 2018

[Solved]D365 FO data entity Synch error

[Updated on: Feb 26, 2020]

Hi Folks,

This quick post about one of the error while working on Data entities,

Error message: Severity Code Description Project File Line Suppression State Error ---> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'I_65518FIELD'. Cannot insert duplicate key in object 'dbo.SQLDICTIONARY'. The duplicate key value is (<tableId>, <FieldId>, 1, 0). 0


Other error messages: 
Severity
Code
Description
Error
(20594,13,1,'SupplierContractId','SUPPLIERCONTRACTID',0,20,0,0,0,0);
Error
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync(SyncOptions options)
Error
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.PartialSync()
Error
at Microsoft.Dynamics.AX.Data.Management.ManagedSyncTableWorker.ExecuteModifyTableViaAlterTable(AxTable newTableSchema, IndexListCache ignoreIndexListCache, IncrementalSyncTableSchemaBuilder tableSchemaBuilder)
Error
Database execution failed: Violation of PRIMARY KEY constraint 'I_65518FIELD'. Cannot insert duplicate key in object 'dbo.SQLDICTIONARY'. The duplicate key value is (20594, 4, 1, 0).
Error
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.SqlCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
Error
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Error
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunPartialTableSync(SyncOptions options, String sqlConnectionString, IMetadataProvider metadataProvider)
Error
at Microsoft.Dynamics.AX.Data.Management.DBExecute.ThrowOnSqlExecuteException(SqlException e, String commandText)
Error
at Microsoft.Dynamics.AX.Data.Sql.SqlDataAccessManager.HandleException(ExceptionDispatchInfo edi, SqlExecutionInfo execInfo)
Error
Inner exceptions:
Error
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
Error
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler)
Error
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

Possible solution: Delete all fields from the staging table and regenerate the same through right-clicking on data entity, refer below.

image

Another thing you should try is, to delete any data import/export project which you may have created while testing. 

Now rebuild your solution and try.

Cheers!!!
Harry

November 04, 2018

[Solved] Error while Sales order Invoice

Hi Folks,

This quick post is about an error while posting a sales order. For functional they know where is the missing piece but if you need some process to test one of your development, I would suggest to dig yourself before asking a functional folk.
Error: Account number for transaction type Cost of goods sold, invoiced does not exist.

image

Reason: Inventory posting have missing setup:

Solution: Go to Inventory > Setup> Posting > Posting
Check if the respective setup is missing. If yes Add record accordingly.

image

That’s it.

Cheers
Harry

October 28, 2018

How to get list of installed Packages/Model/Hotfix

Hi Folks,

Let's see how to get details on installed packages and their model and metadata hotfix detail on an environment (non-production in case of hotfix details). There are different way available to get these list. I will show you simpler one for the quick purpose, at the end of post I will share few links with some PowerShell stuff (really cool) to get more detail around the same.
1. Installed Packages and respective model with version number

Open your application and click on gear icon > About
image

Expand the node ‘Loaded package and their model’, you will get the list to see installed packages and further drilling will give to respective model and version details.

image
2.Installed metadata hotfix, (Click here to check how to install metadata hotfix)

To get this list go back to your DEV box VM and open Visual Studio as admin. Go to Dynamics 365 menu > Addins > Apply hotfix

This will open a new window, select ‘View Installed Hotfixes’ tab

image

Here module refers to Packages while Model is same as std Model in a Package. Smile

Here are few more helpful posts

1.. https://blogs.msdn.microsoft.com/axsupport/2016/09/07/find-which-hot-fixes-kbs-you-have-installed-in-microsoft-dynamics-ax/

2. http://yetanotherdynamicsaxblog.blogspot.com/2018/01/list-hotfixes-using-powershell-in.html

Cheers
Harry.