Skip to main content
Solved

Error: Another process has updated the 'NCRLog' record.

  • April 25, 2024
  • 2 replies
  • 151 views

Forum|alt.badge.img+8
  • Captain II
  • 366 replies

Hey guys,

Hope you are all well,

 

I am working on including some of our ISO records onto Acumatica.

 

I have created a new from for Non-Conformance entries and a substitute GI for the entry screen.

However, I keep receiving the error ‘Error: Another process has updated the 'NCRLog' record. Your changes will be lost.’

 

The first save works fine, however any actions thereafter, e.g., save, delete, cancel, all give that error.

 

Has anyone encountered this before?

I have attached my code files here.

NCRLog.cs

GilcrestMaint.cs

Thanks,

Aleks 

Best answer by NicholasBova52

Hi @aiwan! Hopefully I can provide you with some help here.

Looking at the code provided, I do have some suggestions to potentially fix this issue.

  1.  In the FieldUpdated handler for NCRLog.sOOrderNbr, try replacing the selection of the SOOrder with this:
SOOrder order = SelectFrom<SOOrder>.
                    Where<SOOrder.orderNbr.IsEqual<@P.AsString>>.View.Select(this, row.SOOrderNbr);

Being sure to add “using PX.Data.BQL;” to the file if it’s not already there. With the current query, the SOOrder is set to be selected from the NCRLog.sOOrderNbr field from the record set as Current in cache, but the order number from the FieldUpdated method is also being provided as a parameter, which could cause some issues.

  1. Try replacing the two “SetValue” methods in the FieldUpdated handler with “SetValueExt”. This might not be strictly necessary in this case, but should at least ensure the record is marked as Updated in the cache so it is properly persisted when the user clicks Save.

I can’t be 100% sure this will fix the issue without looking at the full customization project, but it should give you something to start looking into. Let me know if this works!

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

2 replies

NicholasBova52
Acumatica Employee
Forum|alt.badge.img+1
  • Acumatica Employee
  • 27 replies
  • Answer
  • April 26, 2024

Hi @aiwan! Hopefully I can provide you with some help here.

Looking at the code provided, I do have some suggestions to potentially fix this issue.

  1.  In the FieldUpdated handler for NCRLog.sOOrderNbr, try replacing the selection of the SOOrder with this:
SOOrder order = SelectFrom<SOOrder>.
                    Where<SOOrder.orderNbr.IsEqual<@P.AsString>>.View.Select(this, row.SOOrderNbr);

Being sure to add “using PX.Data.BQL;” to the file if it’s not already there. With the current query, the SOOrder is set to be selected from the NCRLog.sOOrderNbr field from the record set as Current in cache, but the order number from the FieldUpdated method is also being provided as a parameter, which could cause some issues.

  1. Try replacing the two “SetValue” methods in the FieldUpdated handler with “SetValueExt”. This might not be strictly necessary in this case, but should at least ensure the record is marked as Updated in the cache so it is properly persisted when the user clicks Save.

I can’t be 100% sure this will fix the issue without looking at the full customization project, but it should give you something to start looking into. Let me know if this works!


Forum|alt.badge.img+8
  • Author
  • Captain II
  • 366 replies
  • April 29, 2024

Hi @NicholasBova52, changing the event handler and the “SetValue” worked like a charm, 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