Solved

PXLockViolationException 2021 R1

  • 2 June 2021
  • 6 replies
  • 286 views

Hi,


I always got PXData.PXLockViolationException a.k.a “another process has added…..”

We are having a upgrade procedure right now.
in my 2019 R1 Project same code, it works, but when on 2021R1, it returns me this error.
Is there a new way to add lines programmatically in 2021 R1?

I always do.

var item = Details.insert();
item.description = someDescription.

Details.Update(item);

but when I do Actions.PressSave() it triggers the error.

been going here for weeks. I tried all solutions I can think about.

 

Thanks,

 

Ed

icon

Best answer by Dmitrii Naumov 2 June 2021, 14:38

View original

6 replies

Userlevel 7
Badge +5

Hi Ed, 

Could you please try to replace Actions.PressSave() with Save.Press()? Or even with just Persist()

Userlevel 7
Badge +17

To identify the root cause, please comment on all the Cache.Update(DACobjects) source code on the particular Graph file and verify.

Even I also faced the same prob but I identified and fixed the root cause like this. Hope this helps!!

This will work with above code also right?

 

yeah, it is still the same error.

Userlevel 7
Badge +17

This will work with above code also right?

 

Hi @Edong ,

Can you try like below by having a new object and verify?

 

DACName obj = new DACName();

obj.ID = PrimaryKeyValues;  

Details.Insert(obj);
obj.description = someDescription.

Details.Update(obj);

this.Actions.PressSave();

 

 

I use PXDBDefault as well as PXParent attributes to auto-populate the lines. or the child table

Userlevel 7
Badge +17

Hi @Edong ,

Can you try like below by having a new object and verify?

 

DACName obj = new DACName();

obj.ID = PrimaryKeyValues;  

Details.Insert(obj);
obj.description = someDescription.

Details.Update(obj);

this.Actions.PressSave();

 

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved