Skip to main content
Solved

Copy field from SO to Invoices

  • 10 March 2023
  • 6 replies
  • 260 views

Hi every one,

I have a custom field on Sale orders named “So Notes” (usrSoNotes), I want copy it to Invoices (image).

I try code below, but still have data. 

public class ARRegisterExt : PXCacheExtension<PX.Objects.AR.ARRegister>
    {
        #region UsrSoNotes
        rPXDBString(800, IsUnicode = true)]
        )PXUIField(DisplayName = "So Notes")]
        tPXDefault(typeof(Search<SOOrderExt.usrSoNotes, Where<SOInvoice.refNbr, Equal<Current<ARRegister.refNbr>>,
             And<SOOrder.orderNbr, Equal<Current<SOInvoice.sOOrderNbr>>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
        public virtual string UsrSoNotes { get; set; }
        public abstract class usrSoNotes : PX.Data.BQL.BqlString.Field<usrSoNotes> { }


  
        #endregion
    }

Thank for your help.

Order Type Setting supports Copying Notes and Attachments to Shipments/Invoices

Hi @thanhaim , you don’t need to do a customization to copy notes/attachments from a Sales Order to Shipment or Invoice.  There are settings in the Order Types that provide you with this capability.


@Dana Moffat, I just visited Order Type in the picture above you provided, I not found position setting for my custom field on Sale orders named “So Notes” (usrSoNotes)(custom field is require). Can you guide me further? Thankyou


@Dana Moffat, I just visited Order Type in the picture above you provided, I not found position setting for my custom field on Sale orders named “So Notes” (usrSoNotes)(custom field is require). Can you guide me further? Thankyou

Hi @thanhaim 

You will not get that option on the Order Types since it is a customization. It would need to be added to a customization package. 


@kandybeatty49 I do a customization this success. Thank for you helped me know the copy setting function.


@thanhaim instead of using a custom field, could you use the Notes generic functionality and leverage the settings in Order Type? 

The Order Type settings can provide the ability to copy the line notes from the sales order to the invoice and/or shipment automatically.

 

 

And in 22R2, you now have the capability to Copy Sales Order header notes to the shipment and/or invoice.

 

 


@Dana Moffat Thank you for sharing.


Reply