在Acumatica中添加新记录时,从另一张表的字段返回一列

问题描述 投票:0回答:2

在销售订单图中,我想从新销售订单上选择的客户那里获取默认仓库,并将其显示在外部参考中。销售订单上的字段(DAC中的CustomerRefNbr)。这是我尝试过的代码。我收到的错误是“结果集太大”。下面是我放置在字段属性中的代码。

    [PXDBString(40, IsUnicode = true)]
[PXUIField(DisplayName = "External Reference")]
[PXDBScalar(typeof(Search2<PX.Objects.CR.LocationExtAddress.cSiteID, InnerJoin<Customer, On<Customer.bAccountID, Equal<PX.Objects.CR.LocationExtAddress.bAccountID>>>, Where<PX.Objects.CR.LocationExtAddress.cSiteID, IsNotNull>>))]



acumatica
2个回答
1
投票

您应该同时使用PXDefault属性和PXFormula属性,如下所示

public class SOOrderEntryDemo : PXGraphExtension<SOOrderEntry>
{
    [PXMergeAttributes(Method = MergeMethod.Merge)]
    [PXDefault(typeof(Search2<INSite.siteCD, InnerJoin<Location, On<Location.cSiteID, Equal<INSite.siteID>>>,
                        Where<Location.bAccountID, Equal<Current<SOOrder.customerID>>,
                            And<Location.locationID, Equal<Current<SOOrder.customerLocationID>>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
    [PXFormula(typeof(Default<SOOrder.customerID, SOOrder.customerLocationID>))]
    public void SOOrder_CustomerRefNbr_CacheAttached(PXCache sender) { }
}

您可以在Overriding Attributes of a DAC field in the Graph上参考Acumatica帮助>


0
投票

客户页面上“位置”标签中的默认位置不包含仓库参考。

© www.soinside.com 2019 - 2024. All rights reserved.