尝试在本地源(MyStaff)和外部数据源目录(我公司的目录)之间建立关系联接.
Trying to make a relational join between a local source (MyStaff) and the external datasource Directory (my company's directory).
但是,没有关联它们的选项.
However, there isn't an option to relate them.
希望创建一个具有自定义字段的本地数据源,我可以将这些字段附加"到现有Directory数据源中的用户记录.
Was hoping to create a local datasource with custom fields that I can "append" to user records from the existing Directory datasource.
感谢您的帮助.
L.
推荐答案无法在目录模型和其他模型类型之间创建关系.您至少可以通过三种方法来解决此短缺问题:
There is no way to create relations between Directory Model and other model types. You have at least three ways to workaround this shortage:
一个
动态查询目录记录-可以很好地处理单记录页面,但是对于列表来说太慢了.
Query directory records on the fly - this will okish work for single-record pages, but it will be tooo slow for lists.
两个
您可以在表中复制所需的目录字段.
You can duplicate Directory fields you need in your tables.
优点:
- 它不会降低您的应用速度
- 它将使您能够使用混合模型数据(目录+驱动器表或Cloud SQL)实现查询
缺点:
- 您将在两个不同的位置存储相同的数据
- 最终,您的目录数据版本会过时
您可以在中找到第二种方法的不错的示例 人际交往应用.
You can find nice sample of the second approach in People Skills app.
三个
按需查询目录数据.假设您有数据绑定列表,并且绑定到列表的记录具有UserEmail字段.在这种情况下,您可以:
Query Directory data on demand. Let's say you have databound list, and records bound to the list have UserEmail field. In this case you can:
app.datasources.Directory.query.filters.PrimaryEmail._equals = widget.datasource.item.UserEmail; app.datasources.Directory.load(); app.showPage(app.pages.UserDetails); // or app.showDialog(app.pages.UserDetails);
更多推荐
Appmaker
发布评论