我是Acumatica的新手,我的代码中有语法错误,似乎找不到它们。 这里是错误和代码。 构建目录“ \ WebSiteValidationDomain \ App_RuntimeCode \”。
\ App_RuntimeCode \ ContractMaint.cs(13):错误CS0305:使用通用类型“ InnerJoin”需要2个类型参数
\ App_RuntimeCode \ ContractMaint.cs(13):错误CS0305:使用通用类型“ InnerJoin”需要2个类型参数
npm i -g degit
答案 0 :(得分:1)
以下版本的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)
{
}
我建议-如果可能的话-您应该首先在Visual Studio中创建这些查询,因为它在此过程中会极大地帮助您。
关于查询:
2.2:BAccount和Location之间的第一次联接中的ON子句似乎丢失了
尝试以下替代版本:
[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)]
请注意,两个版本都会产生多重性。 BAccount /客户与位置之间存在一对多的关系