0

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

Go to Portal Row [Select; First]
Loop
  Delete Portal Row [No Dialog]
  Go To Portal Row [Next; Exit after last]
End Loop
4

1 回答 1

1

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

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

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 to Related Records 脚本步骤去删除记录。就像是:

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]
于 2013-11-11T01:43:46.207 回答