无法从XPiNC引用另一个数据库中的视图 [英] Unable to reference a view in another database from XPiNC

查看:90
本文介绍了无法从XPiNC引用另一个数据库中的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重复一遍,其中值遍历当前数据库中的文档,这些文档包含数据库和视图名称.然后重复操作将打开数据库并查看并从其中检索数据:

I have a repeat where the value loops through documents in the current database, these documents contain a database and view name. The repeat then opens the database and view and retrieves data from within them:

var dbOther:NotesDatabase = session.getDatabase(null, doc.getItemValueString("Database"));
if(dbOther != null){
    var lookupView:NotesView = dbOther.getView(doc.getItemValueString("ViewName"));
    var viewNav:NotesViewNavigator = lookupView.createViewNavFromCategory(key);
}       

这在所有浏览器上都可以正常工作,但是如果我在Notes客户端中查看xpage,则会出现以下错误:调用方法NotesDatabase.getView(string)null

This works fine on all browsers but if I view the xpage in the Notes Client I get the following error: Exception occurred calling method NotesDatabase.getView(string) null

我已经测试了通过将Server和FilePath属性写入日志来设置dbOther变量.我检查了它是否可以通过使用getViews和getAliases生成循环来查看视图,再次将所有视图别名都写入了日志中.

I have tested that the dbOther variable is set by writing the Server and FilePath properties to a log. I checked that it could see the views by generating a loop using getViews and getAliases, again all view aliases were written to the log without an issue.

如果没有从文档中正确选择值但收到相同的错误,我已经手动输入了视图名称.

I have manually entered the view name in case the value was not being selected from the document correctly but received the same error.

有没有办法可以连接到XPiNC中另一个数据库中的视图?我发现了一个XSnippet,它允许您动态地向页面添加视图数据源,我认为这可能可以解决我的问题,但是我想在重新编写所有内容之前先找出是否有替代解决方案!

Is there a way I can connect to a view in another database in XPiNC? I have found an XSnippet which allows you to dynamically add view data sources to your page, I think this may get around my problem but wanted to find out if there was an alternative solution before I re-write everything!

推荐答案

尝试以下其他方法来获取数据库的句柄:

Try some of these other ways of getting a handle on a database:

此命令使用""而不是null参数来指示当前服务器:

This one uses "" instead of the null parameter to indicate current server:

var dbOther:NotesDatabase = session.getDatabase("", doc.getItemValueString("Database"))

此代码使用database.getServer()而不是null参数:

This one uses database.getServer() instead of the null parameter:

var dbOther:NotesDatabase = session.getDatabase(database.getServer(), doc.getItemValueString("Database"))

此人使用sessionAsSigner来访问数据库(而不是使用当前用户的凭据):

This one uses sessionAsSigner to get access to the database (instead of using the credentials of the current user):

var dbOther:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), doc.getItemValueString("Database"))


您是否正在使用Lotus Notes 8.5.3客户端?


Are you using a Lotus Notes 8.5.3 client?

这篇关于无法从XPiNC引用另一个数据库中的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆