Solved

How to Debug a builtin function. i want to debug the delete action of soinvoice screen.

  • 15 January 2024
  • 4 replies
  • 101 views

Greeting all, 
before upgrading to 23r2 there was no problems with 22r1

but after upgrading i am facing an error in invoices screen
There is an error that’s pops up whenever i want to delete any invoice.
says “This record is referenced by at least one 'dbo.SOInvoice' record. The operation cannot be completed.”

 


i unpublished all the customizations and then it worked well,
so i tried and commented The customizations of soinvoice_extension and its dac extensions only but the error still the same.

so i may have to debug the delete action to see why it gives error and how to solve it.

So how to debug the builtin delete action?

icon

Best answer by mohammadessam53 17 January 2024, 16:30

View original

4 replies

Userlevel 7
Badge +4

Hi @mohammadessam53,

For instructions on how debug source code refer, https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=40fcc931-64ac-4016-9d05-7426a22712da

 

As the issue happens only with the customization, do you have any dll that has a graph extension to the screen? If so, you might have to consider debugging the graph extension as well. Good Luck,

I tried to comment the graph extension of soinvoice but it didn’t work.
is there any graph or dac that may cause this error

and for the debugging 
i cannot find the delete method to debug, how could i find it?. 
all i find is an action that is inherited through the graph parent with no method body .
is there a method like Persist but for deleting? and how to find and debug it

ok for those who will come through google in future.

i indeed found graph extension of both arinvoiceEntry and soInvoiceEntry,
when i commented both of them the error is gone and it could be deleted normally,

then i traced the code bit by bit till i found which part was the cause of the error and it somehow ended up being some views

precisely those.

        public PXSelect<ARRegister, Where<ARRegister.refNbr, Equal<Required<ARRegister.refNbr>>, And<ARRegister.docType, Equal<Required<ARRegister.docType>>>>> document;
        public PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>, And<SOOrder.orderType, Equal<Required<SOOrder.orderType>>>>> order;

i removed document view because it wasn’t used
and replace order view with 
PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>, And<SOOrder.orderType, Equal<Required<SOOrder.orderType>>>>>.Select(Base,orderNbr, orderType);
in the event handlers

and it worked.

Userlevel 7
Badge

Thank you for sharing your solution with the community @mohammadessam53!

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