Today want to share with you the case how to add a new button to print alternative Invoice Form right from Invoices and Memos screen.
Fist of all if you check the code, there is no handler for "Print Invoice/Memo". That is some sort of virtual button defined through Acumatica Automation Workflow.
If you click "Fill With Values" button you also can see that this action passing some parameters to code.
Fields those started with "@" is not a read field, they are parameter of functions in the code.
If you check the code of ARDataEntryGraph (that is a parent ARInvoiceEntry and ARCashSaleEntry) than you can find that action handler:
Depend on reportID provided that action just fills report parameter from the code. And than just throws the proper PXReportRequiredException:
That's all, now we know how does it work.
So accordingly to our investigation, if you need to add new button there we need to do 2 things:
- Modify a button handler to handle new report ID
- Amend Automation Steps to register a new Action Menu.
Lets start with the code - here is an example of extension how can you add new report ID to the code:
public class ARInvoiceEntry_Extension : PXGraphExtension<ARInvoiceEntry>
public delegate IEnumerable ReportDelegate(PXAdapter adapter, String reportID);
public IEnumerable Report(PXAdapter adapter, String reportID,
IEnumerable records = baseMethod(adapter, reportID);
//if we are here that means that report is not identified by base method
PXReportRequiredException ex = null;
foreach (ARInvoice doc in records)
var parameters = new Dictionary<string, string>();
if (reportID == "AR641001")
parameters["ARInvoice.DocType"] = doc.DocType;
parameters["ARInvoice.RefNbr"] = doc.RefNbr;
ex = PXReportRequiredException.CombineReport(ex,
if (ex != null) throw ex;
As soon as it is published, you can use Automation Steps to configure new Action:
Please note, that Action will be enabled only on steps where it is defined. That means you may need to add this new action to every single step in Automation (ex Balanced, Hold, Released, etc).
Now you can save everything and test the result.
Have a nice customization!