Skip to main content
Answer

Problem with overriding method under EPReleaseProcess (Expense Claim) graph

  • January 16, 2025
  • 2 replies
  • 71 views

jhonlloydgelica69
Freshman I

Hello :)

I’m trying to override the ReleaseClaimDetails method under the EPReleaseProcess graph using the code below.

 

public delegate List<APRegister> ReleaseClaimDetailsDelegate<TAPDocument, TInvoiceMapping, TGraph, TAPDocumentGraphExtension>
(ExpenseClaimEntry expenseClaimGraph, EPExpenseClaim claim, IEnumerable<EPExpenseClaimDetails> receipts,
string receiptGroupPaidWithType, string transactionType)
where TGraph : PXGraph, new()
where TAPDocument : InvoiceBase, new()
where TInvoiceMapping : IBqlMapping
where TAPDocumentGraphExtension : InvoiceBaseGraphExtension<TGraph, TAPDocument, TInvoiceMapping>;

[PXOverride]
public List<APRegister> ReleaseClaimDetails<TAPDocument, TInvoiceMapping, TGraph, TAPDocumentGraphExtension>
    (ExpenseClaimEntry expenseClaimGraph, EPExpenseClaim claim, IEnumerable<EPExpenseClaimDetails> receipts,
    string receiptGroupPaidWithType, string transactionType,
    ReleaseClaimDetailsDelegate<TAPDocument, TInvoiceMapping, TGraph, TAPDocumentGraphExtension> baseMethod)
    where TGraph : PXGraph, new()
    where TAPDocument : InvoiceBase, new()
    where TInvoiceMapping : IBqlMapping
    where TAPDocumentGraphExtension : InvoiceBaseGraphExtension<TGraph, TAPDocument, TInvoiceMapping>
{
    var docgraph = PXGraph.CreateInstance<TGraph>();

    docgraph.RowInserting.AddHandler<TAPDocument>((sender, e) => {
        var invoice = e.Row as InvoiceBase;
        if (invoice != null && transactionType == ATPTEFMExpenseTypeAttribute.RequestforPayment)
        {
            ATPTEFMEPExpenseClaimExt claimExt = claim.GetExtension<ATPTEFMEPExpenseClaimExt>();
            invoice.ContragentID = claimExt.UsrATPTVendorID;
        }
    });

    return baseMethod(expenseClaimGraph, claim, receipts, receiptGroupPaidWithType, transactionType);
}
 

But a warning appears:

"The signature of a method with the PXOverride attribute must match the overridden method."


 

Best answer by Dmitrii Naumov

@jhonlloydgelica69 Unfortunately generic methods cannot be overridden. You’ll need to put your custom code somewhere else. 

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • January 16, 2025

@jhonlloydgelica69 Unfortunately generic methods cannot be overridden. You’ll need to put your custom code somewhere else. 


jhonlloydgelica69
Freshman I

@jhonlloydgelica69 Unfortunately generic methods cannot be overridden. You’ll need to put your custom code somewhere else. 

Ohh, I see! Thank you for the clarification.