首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过Portal的Filemaker循环

通过Portal的Filemaker循环
EN

Stack Overflow用户
提问于 2013-11-10 22:44:30
回答 1查看 3.7K关注 0票数 0

我正在尝试创建一个循环来删除所有门户行。但循环并没有停止。我做错什么了?

代码语言:javascript
复制
Go to Portal Row [Select; First]
Loop
  Delete Portal Row [No Dialog]
  Go To Portal Row [Next; Exit after last]
End Loop
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-11 01:43:46

我怀疑你在你的人际关系图上有Allow creation of related records through this relationship。这意味着门户中总是有一条记录,而该记录不能被删除,因为它是用户输入新数据的地方。

您可以将脚本修改为如下内容:

代码语言:javascript
复制
Go to Portal Row [Select; First]
Loop
   Delete Portal Row [No dialog]
   Go to Portal Row [Select; First]
   Exit Loop If [IsEmpty(relationship::index)]
End Loop

其中relationship::index是存储在外部表每个字段中的值。

像这样操作门户可能是很棘手的。您可以考虑使用“转到相关记录”脚本步骤Go删除记录。类似于:

代码语言:javascript
复制
Set Error Capture [On]
#
# Attempt to go to the related records, creating a new window "delete records"
Go to Related Record [Show only related records; From table: "<relatedtable>"; Using layout: "<relatedlayout>" (<relatedtable>); New window]
#
# If that failed exit the script. We should still be in the same window and layout.
If [not Get ( LastError )]
   Exit Script []
End If
#
# Otherwise delete all found records
Delete All Records [No dialog]
#
# And close the window we created
Close Window [Name: "delete steps"; Current file]
Set Error Capture [Off]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19896223

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档