Skip to main content
Solved

Transfer SO custom fields to IN custom fields

  • December 18, 2024
  • 1 reply
  • 42 views

Forum|alt.badge.img

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?

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);
}

 

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

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1702 replies
  • Answer
  • December 18, 2024

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


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