我正在尝试在应付款发票的行项目上创建一个必填字段,即税种字段。但是,当我将字段更改为必填字段时,我遇到了明细合计和余额不再在表单上更新的问题。
我尝试做的是消除TaxCategoryID的PXDefault属性的PersistingCheck = PXPersistingCheck.Nothing。这会导致该字段在表单上是必需的,但是,正如我所说的,它也会导致表单不再更新总计。我尝试将PersistingCheck更改为PXPersistingCheck.Null,但这也阻止了总数的更新。
最初,税种字段的PXDefault属性如下所示:
[PXDefault(typeof(Search<InventoryItem.taxCategoryID, 
      Where<InventoryItem.inventoryID, Equal<Current<APTran.inventoryID>>>>), 
      PersistingCheck = PXPersistingCheck.Nothing)]这就是我的代码:
[PXDefault(typeof(Search<InventoryItem.taxCategoryID,
     Where<InventoryItem.inventoryID, Equal<Current<APTran.inventoryID>>>>))]我想要的是能够像往常一样更新税种字段和总额,但我不能,因为代码中的一些东西阻止总额被更新时,税种字段的PXDefault属性被更改。
为了解决这些问题,我还需要做些什么吗?或者我可能走错了路?
发布于 2019-06-25 12:37:43
您需要正确地更改PersistenceCheck并将Required=true添加到PXUIFieldAttribute,以便在列名附近显示一个红色星号符号。请参阅如何使用PXMergeAttributesAttribute和PXCustomizeBaseAttribute执行此操作的示例
public class APInvoiceEntry_Extension : PXGraphExtension<APInvoiceEntry>
{
    #region Event Handlers
    [PXMergeAttributes(Method = MergeMethod.Merge)]
    [PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), nameof(PXUIFieldAttribute.Required),true)]
    [PXCustomizeBaseAttribute(typeof(PXDefaultAttribute), nameof(PXDefaultAttribute.PersistingCheck), null)]
    protected virtual void APTran_TaxCategoryID_CacheAttached(PXCache cache)
    {
    }
    #endregion
}https://stackoverflow.com/questions/56744243
复制相似问题