Where on the invoice/AR transaction can I find the SoLine.UsrCustomerConfig field equivalent?
How to find the SoLine.UsrCustomerConfig field in the invoice/AR files?
Best answer by jinin
Hi
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;
}
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.