Solved

My customize code working fine but when we use software more a week

  • 3 January 2024
  • 3 replies
  • 39 views

Userlevel 2
Badge

My customize code working fine but when we use software more a week, this block of code stop working. But if we restart IIS service, it start working gain. Could you advice how to do it

 

icon

Best answer by Naveen Boga 3 January 2024, 09:02

View original

3 replies

Userlevel 7
Badge +17

@vannakheng66  Have you checked the Request Profiler and reviewed the Resource Usage when using this screen?

 

In my experience, memory leaks can lead to this issue. We need to identify the specific code block causing the problem and address it.

 

 

Userlevel 7
Badge +5

You should also add some logging code into your catch block. If there are errors happening that haven’t been trapped within the try block then who knows what is going on in there.

Userlevel 6
Badge +4

Hi @vannakheng66 

I would suggest make sure your current object pointer is what you expect. Take a look at

Inserting record in the cache

Make sure you are inserting considering your primary key. For Reason Codes is the ReasonCodeID. Then explicitly assign your view’s current pointer.

ReasonCodeMaint instance = PXGraph.CreateInstance<ReasonCodeMaint>();

instance.reasoncode.Current = instance.reasoncode.Insert(new ReasonCode() { ReasonCodeID = this.boqView.Current.BOQCode + "I" });
...

Also when you get the extension you do not need to save before that. You can save just once at the end of the block. Basic DAC and its extensions are part of the same DB record.

 

Hope this helps.

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