将表方法传递给 QueryBuildDataSorce 对象的 addLink 方法
有没有办法将表方法而不是 fieldid 传递给 QueryBuildDataSource 对象的 addLink 方法? 我有这个代码:
qbdsLedgerTrans.addLink(
FieldNum(LedgerTable, AccountNum), // Here i need to pass a conditional value of a LedgerTable method instead of a field
FieldNum(LedgerTrans, AccountNum)
);
Is there any way to pass a table method instead of fieldid to addLink method of a QueryBuildDataSource object?
I have this code:
qbdsLedgerTrans.addLink(
FieldNum(LedgerTable, AccountNum), // Here i need to pass a conditional value of a LedgerTable method instead of a field
FieldNum(LedgerTrans, AccountNum)
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为不会,因为查询 API 与 SQLServer 中的表紧密绑定,并且表不包含 SQLServer 中的任何方法。
#addLink 将用于生成查询连接语句,因此必须使用数据库内存在的数据,并且方法不在数据库中,而是在 aod 文件中。
根据您想要执行的操作,您可以使用一种方法来封装您的逻辑并返回更正后的 fieldId。
I think no because the query API is tightly bound to tables in SQLServer and tables does not contain any method in SQLServer.
The #addLink will be used to generate query join statement so there must use data present inside the database and method are not in the database but in the aod files.
Depending on what you want to do you can have a method to encapsulate your logic and return the corrected fieldId.
addLink
方法的第一个参数必须是先前连接表(在本例中为LedgerTable
)的字段。它可能由函数返回,但我怀疑它会解决您隐藏的(未说明的)问题。addLink
方法的第二个参数必须是当前数据源表的字段。在其他情况下(形成延迟连接),您可以改用
addDynalink
方法。The first argument to the
addLink
method must be an field of the prior joined table, in this caseLedgerTable
. It may be returned by a function, but I doubt it will solve your hidden (unstated) problem.The second argument to the
addLink
method must be an field of the current datasource table.In other scenarios (form delayed joins) you could use the
addDynalink
method instead.