对 ID 字段重新编号
Filemaker 非常新。使用 Filemaker 11 pro。
我想知道在记录之间插入新记录后是否可以对 ID 字段列重新编号?也许使用脚本触发器?
谢谢
Very new to Filemaker. Using Filemaker 11 pro.
I was wondering if it was possible to renumber an ID field column after doing an insert new record in between records? Maybe using a script trigger?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我同意 Jesse 的观点,即对记录的唯一 ID/索引重新编号听起来不是一个好主意,更多信息或您尝试执行的操作示例会有所帮助。
如果您只想显示记录编号,您可以使用计算“Get (RecordNumber)”创建一个未存储的计算字段。这应该始终显示正在显示搜索结果中的哪条记录。 FileMaker 的定义可在此处找到:http://www.filemaker.com/help/html /func_ref2.32.55.html
另一方面,如果您尝试为显示的记录制定唯一的排序顺序,最好通过创建新的 SortIndex 数字字段来实现。 (您需要确保您显示的布局始终按 SortIndex 字段排序,这可以使用布局脚本触发器来完成,并且可能使用自定义菜单覆盖排序菜单命令。)
要考虑的一种方法是使用自定义菜单覆盖新记录命令。选择“新记录”后,您可以将其路由到执行以下操作的脚本:
I agree with Jesse that renumbering a record's unique ID/Index doesn't sound like a good idea and more information or an example of what you're trying to do would help.
If you simply want to display the Record Number, you could create an unstored calculation field with the calculation "Get ( RecordNumber )". This should always display which record, of the found set, is being displayed. FileMaker's definition is available here: http://www.filemaker.com/help/html/func_ref2.32.55.html
If, on the other hand, you're trying to make a unique sort order for the records being shown, it is best to do this by creating a new SortIndex numeric field. (You'd need to make certain that the layout that you're displaying was always sorted by the SortIndex field which can be done using layout script triggers and, possibly, overriding the Sort menu commands using Custom Menus.)
One method to consider would be overriding the New Record command using Custom Menus. When New Record is selected you might route it to a script which does something like this: