Acumatica 使用多个联接和where子句搜索2
我是Acumatica的新手,代码中有语法错误,似乎找不到。 下面是错误和代码。 正在生成目录“\WebSiteValidationDomain\App\u RuntimeCode\” \App_RuntimeCode\ContractMaint.cs(13):错误CS0305:使用泛型类型“InnerJoin”需要2个类型参数Acumatica 使用多个联接和where子句搜索2,acumatica,Acumatica,我是Acumatica的新手,代码中有语法错误,似乎找不到。 下面是错误和代码。 正在生成目录“\WebSiteValidationDomain\App\u RuntimeCode\” \App_RuntimeCode\ContractMaint.cs(13):错误CS0305:使用泛型类型“InnerJoin”需要2个类型参数 [PXMergeAttributes(Method = MergeMethod.Merge)] [PXDefault(typeof(Searc
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDefault(typeof(Search2<PX.Objects.CR.Location.cSiteID,
InnerJoin<PX.Objects.CR.BAccount, On<PX.Objects.CR.BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>,
InnerJoin<PX.Objects.AR.Customer, On<PX.Objects.AR.Customer.bAccountID, Equal<PX.Objects.CR.BAccount.bAccountID>>>,
InnerJoin<PX.Objects.CR.Location, On<PX.Objects.CR.Location.bAccountID, Equal<PX.Objects.AR.Customer.bAccountID>>>>,
Where <PX.Objects.CR.BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
[PXFormula(typeof(Default<PX.Objects.CR.Location.cSiteID> ))]
protected virtual void XRBContrHdr_DestSiteID_CacheAttached(PXCache cache)
{
}```
\App_RuntimeCode\ContractMaint.cs(13):错误CS0305:使用泛型类型“InnerJoin”需要2个类型参数
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDefault(typeof(Search2<PX.Objects.CR.Location.cSiteID,
InnerJoin<PX.Objects.CR.BAccount, On<PX.Objects.CR.BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>,
InnerJoin<PX.Objects.AR.Customer, On<PX.Objects.AR.Customer.bAccountID, Equal<PX.Objects.CR.BAccount.bAccountID>>>,
InnerJoin<PX.Objects.CR.Location, On<PX.Objects.CR.Location.bAccountID, Equal<PX.Objects.AR.Customer.bAccountID>>>>,
Where <PX.Objects.CR.BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
[PXFormula(typeof(Default<PX.Objects.CR.Location.cSiteID> ))]
protected virtual void XRBContrHdr_DestSiteID_CacheAttached(PXCache cache)
{
}```
[PXMergeAttributes(Method=MergeMethod.Merge)]
[PXDefault(typeof(Search2),PersistingCheck=PXPersistingCheck.Nothing)]
[PXFormula(typeof(默认))]
受保护的虚拟无效XRBConthrdr_DestSiteID_CacheAttached(PXCache缓存)
{
}```
以下版本的BQL工作正常:
通过在名称空间顶部添加PX.objects.xx库,我简化了对象
using PX.Objects.CR;
using PX.Objects.AR;
...
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDefault(typeof(Search2<Location.cSiteID,
InnerJoin<BAccount,
On<BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>,
InnerJoin<Customer,
On<Customer.bAccountID, Equal<BAccount.bAccountID>>,
InnerJoin<Location,
On<Location.bAccountID, Equal<Customer.bAccountID>>>>>,
Where<BAccount.acctCD, Equal<Current<XRBContrHdr.customerID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
[PXFormula(typeof(Default<PX.Objects.CR.Location.cSiteID>))]
protected virtual void XRBContrHdr_DestSiteID_CacheAttached(PXCache cache)
{
}
使用PX.Objects.CR;
使用PX.Objects.AR;
...
[PXMergeAttributes(Method=MergeMethod.Merge)]
[PXDefault(typeof(Search2),PersistingCheck=PXPersistingCheck.Nothing)]
[PXFormula(typeof(默认))]
受保护的虚拟无效XRBConthrdr_DestSiteID_CacheAttached(PXCache缓存)
{
}
如果可能的话,我建议您首先在VisualStudio中创建这些查询,因为它在这个过程中非常有帮助
关于查询:
[PXDefault(typeof(Search2<Location.cSiteID,
InnerJoin<BAccount,
On<BAccount.bAccountID, Equal<Location.bAccountID>>,
InnerJoin<Customer,
On<Customer.bAccountID, Equal<BAccount.bAccountID>>>>,
Where<BAccount.bAccountID, Equal<Current<XRBContrHdr.customerID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
[PXDefault(typeof(Search2),PersistingCheck=PXPersistingCheck.Nothing)]
请注意,这两个版本都将生成多重性。BAccount/Customer和Location之间存在一对多的关系@TRex您是否能够测试建议的答案?