Loading ...

Cannot Insert Explicit Value For Identity Column In Table When Identity_insert Is Set To Off In Acumatica

Hello everybody,

today I received the following error message in Acumatica:

Cannot insert explicit value for identity column in table when identity_insert is set to off.

After executing SQL

SET IDENTITY_INSERT table off

problem wasn't solved, so I needed to search deeper. After attaching with SQL Profiler, I noticed that Acumatica generated SQL, which tried to insert null into key field. Then was time to look in manual. 

And then I noticed that for key fields statement IsKey = true is not used. Instead is used 

[PXDBIdentity]

So I replaced [PXDBInt(IsKey = true)] with [PXDBIdentity] and problem disappeared.

 

Encountering unique challenges in Acumatica development, like the identity column issue, highlights the importance of precise customization to fit your business needs. If you’ve faced similar hurdles or have specific requirements that demand tailored solutions, don’t let them slow you down. Leave a customization request today, and let’s transform your Acumatica experience into one that works seamlessly for you. Your perfect solution is just a request away!