Acumatica - BQL - 使用泛型类型&#39; PX.Data.InnerJoin <table,on>&#39;需要2个类型参数

时间:2017-10-30 00:07:24

标签: acumatica

代码:

foreach (ARTran tran in PXSelect<ARTran, InnerJoin<ContractItem, 
On<ContractItem.contractItemID, Equal<ARTran.inventoryID>>,
Where<ARTran.tranType, Equal<Required<ARInvoice.docType>>,
And<ARTran.refNbr, Equal<Required<ARInvoice.refNbr>>>>,
OrderBy<Asc<ARTran.tranType, Asc<ARTran.refNbr,
Asc<ARTran.lineNbr>>>>>>
.Select(Base, invoice.DocType, invoice.RefNbr))

当我尝试发布时,我得到以下内容:

\ App_RuntimeCode \ ARReleaseProcess.cs(67):错误CS0305:使用泛型类型&#39; PX.Data.InnerJoin&#39;需要2个类型参数 \ App_RuntimeCode \ ARReleaseProcess.cs(67):错误CS0305:使用泛型类型&#39; PX.Data.InnerJoin&#39;需要2个类型参数

1 个答案:

答案 0 :(得分:0)

下面的BQL查询应该编译没有任何错误:

foreach (ARTran tran in PXSelectJoin<ARTran, 
    InnerJoin<ContractItem, 
        On<ContractItem.contractItemID, Equal<ARTran.inventoryID>>>, 
    Where<ARTran.tranType, Equal<Required<ARInvoice.docType>>, And<ARTran.refNbr, Equal<Required<ARInvoice.refNbr>>>>, OrderBy<Asc<ARTran.tranType, Asc<ARTran.refNbr, Asc<ARTran.lineNbr>>>>>
    .Select(Base, invoice.DocType, invoice.RefNbr))
{
    ...
}