Skip to main content
Answer

How to find the SoLine.UsrCustomerConfig field in the invoice/AR files?

  • May 28, 2025
  • 2 replies
  • 56 views

Where on the invoice/AR transaction can I find the SoLine.UsrCustomerConfig field equivalent?

Best answer by jinin

Hi ​@Phalbert ,

The custom field SoLine.UsrCustomerConfig on the Sales Order line (SOLine) can be mapped to the AR Invoice line (ARTran) during the invoice creation process from the Sales Order. To achieve this, you need to do a small customization

1. Extend the ARTran DAC
2. Extend the SOInvoiceEntry Graph

Example:
public class ARTranExt : PXCacheExtension<ARTran>
{
    #region UsrCustomerConfig
    [PXDBString(50)]
    [PXUIField(DisplayName = "Customer Config")]
    public virtual string UsrCustomerConfig { get; set; }
    public abstract class usrCustomerConfig : PX.Data.BQL.BqlString.Field<usrCustomerConfig> { }
    #endregion
}

public class SOInvoiceEntry_Extension : PXGraphExtension<SOInvoiceEntry>
{
    protected virtual void ARTran_RowInserting(PXCache sender, PXRowInsertingEventArgs e)
    {
        ARTran row = e.Row as ARTran;
        if (row == null) return;

        SOLine soLine = PXSelect<SOLine,
            Where<SOLine.orderType, Equal<Required<SOLine.orderType>>,
            And<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>,
            And<SOLine.lineNbr, Equal<Required<SOLine.lineNbr>>>>>>.Select(Base, row.SOOrderType, row.SOOrderNbr, row.SOOrderLineNbr);

        if (soLine != null)
        {
            var rowExt = PXCache<ARTran>.GetExtension<ARTranExt>(row);
            var soExt = PXCache<SOLine>.GetExtension<SOLineExt>(soLine);
            rowExt.UsrCustomerConfig = soExt?.UsrCustomerConfig;
        }
    }
}
 

2 replies

Forum|alt.badge.img+1
  • Semi-Pro I
  • May 28, 2025

Fields that start with “usr” are typically part of customizations; I don’t see this as a standard field.  I know we’ve struggled with figuring out the best place to store some of these soline/shipment line/artran data items and what should get copied down the chain.  You can join ARTran back to SOLine, but we’ve found that if our customization includes plugging into invoice creation in some way, it’s great if we copy these user fields to ARTran as well.


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • May 29, 2025

Hi ​@Phalbert ,

The custom field SoLine.UsrCustomerConfig on the Sales Order line (SOLine) can be mapped to the AR Invoice line (ARTran) during the invoice creation process from the Sales Order. To achieve this, you need to do a small customization

1. Extend the ARTran DAC
2. Extend the SOInvoiceEntry Graph

Example:
public class ARTranExt : PXCacheExtension<ARTran>
{
    #region UsrCustomerConfig
    [PXDBString(50)]
    [PXUIField(DisplayName = "Customer Config")]
    public virtual string UsrCustomerConfig { get; set; }
    public abstract class usrCustomerConfig : PX.Data.BQL.BqlString.Field<usrCustomerConfig> { }
    #endregion
}

public class SOInvoiceEntry_Extension : PXGraphExtension<SOInvoiceEntry>
{
    protected virtual void ARTran_RowInserting(PXCache sender, PXRowInsertingEventArgs e)
    {
        ARTran row = e.Row as ARTran;
        if (row == null) return;

        SOLine soLine = PXSelect<SOLine,
            Where<SOLine.orderType, Equal<Required<SOLine.orderType>>,
            And<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>,
            And<SOLine.lineNbr, Equal<Required<SOLine.lineNbr>>>>>>.Select(Base, row.SOOrderType, row.SOOrderNbr, row.SOOrderLineNbr);

        if (soLine != null)
        {
            var rowExt = PXCache<ARTran>.GetExtension<ARTranExt>(row);
            var soExt = PXCache<SOLine>.GetExtension<SOLineExt>(soLine);
            rowExt.UsrCustomerConfig = soExt?.UsrCustomerConfig;
        }
    }
}