扩展或修改数据视图

时间:2017-03-22 21:23:59

标签: acumatica

是否可以扩展页面图并修改数据库?

我有一个新页面,它将为现有客户添加位置,但希望这些位置仅显示在我的页面上,而不是显示在客户页面的位置选项卡中。 因此,我将扩展Location表以识别从我的新页面创建的记录,并且必须将Customer Locations Datamember修改为以下

    public PXSelect<LocationExtAddress, Where<LocationExtAddress.locationBAccountID, Equal<Current<BAccount.bAccountID>,
And<LocationExtAddess.extendedField, IsNull>>>> Locations;

1 个答案:

答案 0 :(得分:1)

BusinessAccountGraphBase 类(这是CustomerMaint的基类)中声明的Locations数据视图没有声明委托:

public class BusinessAccountGraphBase<Base, Primary, WhereClause> : PXGraph<BusinessAccountGraphBase<Base, Primary, WhereClause>>
    where Base : BAccount, new()
    where Primary : class, IBqlTable, new()
    where WhereClause : class, IBqlWhere, new()
{
    ...
    public PXSelect<LocationExtAddress, Where<LocationExtAddress.locationBAccountID, Equal<Current<BAccount.bAccountID>>>> Locations;
    ...
}

因此,要在Customers屏幕上修改Locations数据视图,您只需为CustomerMaint BLC创建一个扩展,如下所示:

public class CustomerMaintExt : PXGraphExtension<CustomerMaint>
{
    public PXSelect<LocationExtAddress, 
        Where<LocationExtAddress.locationBAccountID, Equal<Current<BAccount.bAccountID>,
            And<LocationExtAddess.extendedField, IsNull>>>> Locations;
}

有关此主题的更多信息,请参阅Acumatica Customization Guide