Hi,
My application releases payment via this event

Is there opportunity to return Checks and Payments item status from “Closed” to “Balanced” ?

Hi,
My application releases payment via this event
Is there opportunity to return Checks and Payments item status from “Closed” to “Balanced” ?
That looks mostly correct but that is the wrong graph if you are trying to reverse an application.
ReverseApplication is an action on the APPaymentEntry graph. You will typically call an action as
APPaymentEntry.reverseApplication.Press(adapter)
The adapter is optional you can also just call Press(). The case does matter as reverseApplication is the PXAction and ReverseApplication is the handler(you can call this directly but it is generally advisable to use the action, and calling it directly you will have to supply an adapter).
Hi
You can reverse the applications that closed the check to bring it back to an OPEN state but you cannot get it back to a BALANCED state.
BALANCED → OPEN for AR/AP Documents involves posting to the GL at that point you would need to void(or create a canceling document) instead of deleting or changing the document.
Voiding a check will move it to the voided status.
Hi
Hi
Thanks for the reply
I stopped at the stage that I described in my last comment, can’t fix it still
Yes, it is possible.
you can invoke form Base graph like below.
Base.putonhold.Press();
Base.ReleaseFromHold.Press();
Your breakpoints aren’t bound, that’s what that little hazard icon on them means. Calling the press method generates the adapter before calling the actual handler. If you hover over the breakpoints visual studio should tell you why they aren’t bound. I think by default Visual Studio has the “Just My Code” setting enabled that you would need to disable to debug Acumatica code.
Here’s an article that goes a bit more in depth: https://asiablog.acumatica.com/2016/04/debug-acumatica-code.html
Void will void the check and it creates a Voided Check document to cancel out the original check.
Via the APPaymentEntry graph the action is called ReverseApplication so yes you can invoke it programmatically. It creates an inverted application against the check that will move it from closed → open once released. You can invoke actions on graphs by using iGraph(Instance)].eAction].Press().
Edit: if you are making a process screen you will likely want to use PXGraph.CreateInstance to get an instance of the APPaymentEntry graph. You can then set the current document to whatever APPayment you are handling and invoke the necessary actions.
It sounds like ReverseApplication is what you are looking for. Voiding will void(cancel) the payment.
Hi
.
ReverseApplication just reverses the currently selected application which is the adjustment that applies x amount from the check to a document(usually an AP Invoice).
If you are trying to void a check there is a voidCheck action that you can call in the same way.
You are also not searching for APInvoice.refNbr you should be searching for APPayment.refNbr.
You place a breakpoint inside the ReverseApplication method in APPaymentEntry.cs then walk through that method to see what is causing the error.
A limited subset of the Acumatica source code is kept inside the CodeRepository folder and you can use it for debugging.
The breakpoint should trigger once the action is called. From there you can just step through the method and figure out where/why the error is occurring.
No, you would navigate to APPaymentEntry.cs which is in the Acumatica source code and add a breakpoint at the start of the ReverseApplication method.
You place a breakpoint inside the ReverseApplication method in APPaymentEntry.cs then walk through that method to see what is causing the error.
I must override reverseApplication method ?
Because “go to implementation” option is not available and “go to definition” gives me this
At this point you just need to do some standard debugging to figure out what is causing the issue. It would seem that something is attempting to set that field to a null value(trying to cast null as a non-nullable decimal would cause that error) . I would try and figure out where in the ReverseApplication method is triggering the event handler and track the value of that field.
When a payment is released it is really just releasing the adjustments that are under the Document to Apply tab, a payment is moved to the closed status when it no longer has an open balance on it. Released adjustments will show under the application history tab.
So what your code is supposed to be doing is setting the Current adjustment and then invoking the reverse application action.
Assuming the payment does have an adjustment to be reversed I would check that your code is getting that record and setting it to the current value(debug and check the variable values). And if that all looks good, you can debug into the reverseApplication method to get a more exact idea of what is throwing that error.
I checked record for setting to the current value and it looks good. I am receiving adjustment
How exactly I should debug into the reverseApplication ? Its just throwing exception here
When a payment is released it is really just releasing the adjustments that are under the Document to Apply tab, a payment is moved to the closed status when it no longer has an open balance on it. Released adjustments will show under the application history tab.
So what your code is supposed to be doing is setting the Current adjustment and then invoking the reverse application action.
Assuming the payment does have an adjustment to be reversed I would check that your code is getting that record and setting it to the current value(debug and check the variable values). And if that all looks good, you can debug into the reverseApplication method to get a more exact idea of what is throwing that error.
Can you explain what adjustments it should contain ?
I need to process any Payments that were released accidently and return them back
I checked my item
Is there universal approach to return Payments back after they were released ?
A limited subset of the Acumatica source code is kept inside the CodeRepository folder and you can use it for debugging.
The breakpoint should trigger once the action is called. From there you can just step through the method and figure out where/why the error is occurring.
Hi
I entered this method
but debug do not enter here. Project is built.
Can be problem be in moment that this method requires PXAdapter, but I do not send this object
If problem can be in that , how I must send it here ?
Your breakpoints aren’t bound, that’s what that little hazard icon on them means. Calling the press method generates the adapter before calling the actual handler. If you hover over the breakpoints visual studio should tell you why they aren’t bound. I think by default Visual Studio has the “Just My Code” setting enabled that you would need to disable to debug Acumatica code.
Here’s an article that goes a bit more in depth: https://asiablog.acumatica.com/2016/04/debug-acumatica-code.html
it causes error in this method
no setting the current record on a view means
>GRAPH NAME]..VIEW NAME].Current = Record]
That is what you are doing with the Document view when you
graph.Document.Current = graph.Document.Search<APPayment.refNbr>(referenceNbr);
So assuming the view name is APPost you would need something like(this would just select the first record of the view).
graph.APPost.Current = graph.APPost.SelectSingle();
If you are getting an error when trying to inspect the action/grid then you have something else going on. I would check the trace(there should be more detailed error messages there) and look through your customizations to find which one is causing the issue.
Thanks for provided code
can you help with this error , I checked it at stack trace as you have suggested
At this point you just need to do some standard debugging to figure out what is causing the issue. It would seem that something is attempting to set that field to a null value(trying to cast null as a non-nullable decimal would cause that error) . I would try and figure out where in the ReverseApplication method is triggering the event handler and track the value of that field.
It looks like I do it in wrong way or this approach does not fit for my goal.
I can not currently debug it as usually, because when I try to check the callstack of Acumatica it gives me this
Also in watch not all object are available for check
Is there opportunity to troubleshoot it ?
You would want to catch the event handler using a breakpoint. You would step through the ReverseApplication method line by line and see where it is triggering that event handler. You shouldn’t need to debug the file in your screenshot. Some values will be optimized away and not available to read.
You would want to catch the event handler using a breakpoint. You would step through the ReverseApplication method line by line and see where it is triggering that event handler. You shouldn’t need to debug the file in your screenshot. Some values will be optimized away and not available to read.
The error occurs in Adjustments.Update(adj); row. In Update method it calls this event
Hi
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.