Hello - We currently have custom Start and End date fields on the sales order screen and also on the AR invoice screen. However now we would like to be able to send values from the SO fields to the AR invoice fields. Can someone please tell me how we can achieve this?
Solved
Transfer SO custom fields to IN custom fields
Best answer by darylbowman
Because an Order can be invoiced from ‘Sales Orders’ and ‘Shipments’, you need a method called by both of them. You’ll want to extend the InvoiceCreated method of SOInvoiceEntry like this:
public delegate void InvoiceCreatedDelegate(ARInvoice invoice, InvoiceOrderArgs args);
[PXOverride]
public virtual void InvoiceCreated(ARInvoice invoice, InvoiceOrderArgs args, InvoiceCreatedDelegate baseMethod)
{
baseMethod(invoice, args);
// Put your code here like:
Base.Document.SetValueExt<ARInvoice.docDesc>(invoice, "Some new description");
Base.Document.Update(invoice);
}
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.