Hello all,
Is it possible to override a private method of a graph? There have been several times where I have would have liked to, but I lack the rights to such methods from extensions since they are technically different objects as the base graph. Does anyone have a work around for this?
It’s frustrating seeing the exact line of code I need to change to do a simple customization but lacking access to it to make the change. Instead I end up writing an inefficient workaround using event handlers.
Edit: For example, right now I’d like to override OpportunityMaint.FillDefaultBAccountID(), but I can’t using the standard PXOverride attribute & delegate since it’s private.
Solved
Override Private Method
Best answer by Hughes Beausejour
The workaround is to find all public methods (actions/event handlers) that calls the private method and override them instead of the private method. The worst case scenarios requires to replace the graph with a custom one.
For OpportunityMaint.FillDefaultBAccountID there are two public event handlers to override:
- CROpportunity_RowInserted
- CROpportunity_RowUpdated
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.