Skip to main content
Solved

Strange Behavior when saving customer with deletedatabaserecord=1

  • December 7, 2020
  • 5 replies
  • 293 views

Forum|alt.badge.img+5
  • Captain II
  • 398 replies

This issue brothers me for a long time.

I have two environments. 1 for development, 1 for production. I did the same steps as below:

1, Create a new customer named "TESTID"

2, Delete the "TESTID" after creation immediately. At this time, it would be marked deleteddatabaserecord =1 in BAccount table.

Now, here comes huge different. If I recreated the "TESTID" in my development environment, the system allows and just update the deleteddatabaserecord to 0 and other fields updated according to new input. However, the production environment won't allow to created the customer "TESTID", says "Can not insert duplicated line into object "dbo.BAccount" with unique index. The duplicated key is (2,TESTID)"

This issue also happens to other entities, such as Stock Item. So is there a switch or specific setting?I would be really appreciated if somebody could give me the right direction.

Best answer by Irina

It differs by the database server and by the database schema of the entity.

The root cause is that the inserting of the duplicated key is prohibited on the database level, and since we should store deleted records for a while in a database, getting rid of this issue will require a massive change in the current architecture.

View original
Did this topic help you find an answer to your question?

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • December 8, 2020

Hi @ray20,

I have verified this in 20 R2 instance by following above-mentioned steps but I didn’t any issue. In fact its working great for me.


Irina
Community Manager
Forum|alt.badge.img+8
  • Acumatica Support Analyst
  • 524 replies
  • December 8, 2020

Forum|alt.badge.img+5
  • Author
  • Captain II
  • 398 replies
  • December 9, 2020

@Irina 
Hello Irina, thank you very much for logging it as a known issue.
In fact, I was doing “work around” for a long time. I just rename the old record (which I’d like to delete/ Or someone has deleted) and create a new record with the name I want to reuse.
This is workable. 
Also this need(to recreate a deleted item) might happen only 2 or 3 times a year, so it does not matter much.

I am just curious, and you know, very much like to know the root cause, for an IT stuff. I just don’t quite understand, the exactly same Acumatica version, the exactly same .Net framework and DB version, why the system works differently?
Why in 1 environment is an “Insert” and in another it is a “Update”?
Can you kindly help me to understand the puzzle better?
Thank you.


Irina
Community Manager
Forum|alt.badge.img+8
  • Acumatica Support Analyst
  • 524 replies
  • Answer
  • December 9, 2020

It differs by the database server and by the database schema of the entity.

The root cause is that the inserting of the duplicated key is prohibited on the database level, and since we should store deleted records for a while in a database, getting rid of this issue will require a massive change in the current architecture.


Forum|alt.badge.img+5
  • Author
  • Captain II
  • 398 replies
  • December 9, 2020
Irina wrote:

It differs by the database server and by the database schema of the entity.

The root cause is that the inserting of the duplicated key is prohibited on the database level, and since we should store deleted records for a while in a database, getting rid of this issue will require a massive change in the current architecture.

@Irina Now, understand fully. Thank you.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings