Skip to main content
Solved

PXLockViolationException 2021 R1

  • 2 June 2021
  • 6 replies
  • 329 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

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

 

 


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


This will work with above code also right?

 


This will work with above code also right?

 

yeah, it is still the same error.


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


Hi Ed, 

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


Reply