Skip to main content
Solved

PXLockViolationException 2021 R1


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

Best answer by Dmitrii Naumov

Hi Ed, 

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

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

6 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 2, 2021

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();

 

 


  • Author
  • Freshman I
  • 3 replies
  • June 2, 2021
Naveen B wrote:

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 2, 2021

This will work with above code also right?

 


  • Author
  • Freshman I
  • 3 replies
  • June 2, 2021
Naveen B wrote:

This will work with above code also right?

 

yeah, it is still the same error.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • June 2, 2021

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!!


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 632 replies
  • Answer
  • June 2, 2021

Hi Ed, 

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


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