Skip to main content
Solved

Problem with overriding method under EPReleaseProcess (Expense Claim) graph


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. 

View original
Did this topic help you find an answer to your question?

2 replies

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

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


jhonlloydgelica69
Freshman I
Dmitrii Naumov wrote:

@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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings