Skip to main content

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

 

@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.

 

 


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.


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