I have created an extension for ARInvoiceEntry with a custom action that replicates SendARInvoiceMemo but adds an additional attachment to the invoice notification email.
This works as expected with an extra button, but I need it to replace the original action. I have used the same name for it to overload the existing one but it doesn't seem to work.
How can I force Acumatica to use my action in the GraphExtension instead of the original?
Here is my extended action code:
public PXAction<ARInvoice> sendARInvoiceMemo;
[PXUIField(DisplayName = "+Send AR Invoice/Memo+", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXLookupButton]
public virtual IEnumerable SendARInvoiceMemo(PXAdapter adapter,
[PXString]
string reportID)
{
var cfdi = ARInvoiceXmlDownload.GetXmlAttachment(this.Base, this.Base.Document.Current);
if (cfdi == null)
{
return Base.SendARInvoiceMemo(adapter, reportID);
}
ARInvoice invoice = this.Base.Document.Current;
if (reportID == null) reportID = "AR641000";
if (invoice != null)
{
Dictionary<string, string> mailParams = new Dictionary<string, string>();
mailParams["DocType"] = invoice.DocType;
mailParams["RefNbr"] = invoice.RefNbr;
var sent = false;
var activities = PX.Objects.EP.ReportNotificationGenerator.Send(reportID, mailParams);
var updatedActivities = new List<EPActivity>();
foreach (var act in activities)
{
AddCfdi(act, cfdi.UID);
sent = true;
}
if (sent)
{
this.Base.Caches<NoteDoc>().Persist(PXDBOperation.Insert);
}
else
{
throw new PXException(ErrorMessages.MailSendFailed);
}
this.Base.Clear();
this.Base.Document.Current = this.Base.Document.Search<ARInvoice.refNbr>(invoice.RefNbr, invoice.DocType);
}
return adapter.Get();
}
Edit for clarification as requested
This is for Acumatica v5.30.2741
This is the action in Invoices and Memos (AR301000) I need to replace:

It is also used in Print Invoices and Memos (AR508000) to send several invoices in a process:



