将自定义字段添加到发票中的添加 SO 行对话框 [英] Adding custom field to Add SO Line dialog box in Invoices
问题描述
我在
发布后,新字段应在添加 SO 行"对话框中可见.
I have created a custom field called HS Code in Stock Items (Screen ID IN202500) and managed to display it at line level on Sales Orders (Screen ID - SO301000) by customizing its attribute as shown below.
public class SOLineExt : PXCacheExtension<PX.Objects.SO.SOLine>
{
#region UsrHSCode
[PXDBString(50)]
[PXUIField(DisplayName = "HS Code", Visible = true, Enabled = false)]
[PXFormula(typeof(Selector<SOLine.inventoryID, InventoryItemExt.usrHSCode>))]
public virtual string UsrHSCode { get; set; }
public abstract class usrHSCode : PX.Data.BQL.BqlString.Field<usrHSCode> { }
#endregion
}
How would I go about adding the same field to Add SO Line dialog box on Invoices (Screen ID SO303000)?
How can I referenced the custom field correctly on Add SO Line dialog box on Invoices screen?
You would need to extend the SOLineForDirectInvoice DAC. Now this DAC is a projection and not an actual table as such all you have to do is extend the DAC itself. When declaring the field make use of the BqlField property on the type attribute this will instruct acumatica from where to read the value for the field Eg:
#region UsrHSCode
[PXDBString(50, BqlField = typeof(SOLineExt.usrHSCode))]
[PXUIField(DisplayName = "HS Code", Visible = true, Enabled = false)]
public virtual string UsrHSCode { get; set; }
public abstract class usrHSCode : PX.Data.BQL.BqlString.Field<usrHSCode> { }
#endregion
Once this is defined in the DAC extension you will be able to add it to the Add SO Line dialog which can be found under the dialog section of the layout editor
Once published the new field should be visible in the Add SO Line dialog.
这篇关于将自定义字段添加到发票中的添加 SO 行对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!