In an Acumatica customization, I want to check journal entries after they are posted to see if they are being posted to a specific branch so I can create entries for another Tenant.
I am using the JournalEntry graph and creating a delegate on the ReleaseBatch method.
I know the extension is being hit because anytime I click anything on the Journal Entry screen, breakpoint on private bool testingExtensionIsActive = true; gets hit.
In order to get the code to compile I had to put the ReleaseBatchDelegate baseMethod before the bool unholdBatch = false parameter. Optional parameters have to go at the end of the signature. Normally the baseMethod goes at the end of the signature for the other delegates I have created.
I also tried another delegate just to see if I could get ANYTHING to work. The second delegate in my code is for the PostGraph graph. It has a simple signature so I thought that would rule out the issue I just describe above with the optional paramater.
I cannot hit the breakpoint set on string joe = "joe"; in either delegate.
...
public class JournalEntry_Extension : PXGraphExtension<JournalEntry>
{
private bool testingExtensionIsActive = true;
public delegate void ReleaseBatchDelegate(IList<Batch> list, IList<Batch> externalPostList, bool unholdBatch);
public virtual void ReleaseBatch(IList<Batch> list, IList<Batch> externalPostList, ReleaseBatchDelegate baseMethod,
bool unholdBatch = false)
{
string joe = "joe";
baseMethod(list, externalPostList, unholdBatch);
}
}
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class PostGraph_Extension : PXGraphExtension<PostGraph>
{
public delegate void PostBatchProcDelegate(Batch b);
public virtual void PostBatchProc(Batch b, PostBatchProcDelegate baseMethod)
{
string joe = "joe";
baseMethod(b);
}
}
...
I confirmed I am using the correct graphs/methods as I am able to hit breakpoints in both methods I am trying to override.
This is the breakpoint in the ReleaseBatch method of the JournalEntry graph:
This is the breakpoint on the PostGraph method
What am I doing wrong? Any help would be greatly appreciated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…