【问题标题】:Filemaker Loop Through PortalFilemaker 循环通过门户
【发布时间】:2013-11-22 15:45:45
【问题描述】:

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

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

【问题讨论】:

    标签: loops portal filemaker


    【解决方案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]
    

    【讨论】:

    • 钱!我确实允许“允许通过这种关系创建相关记录”并且我尝试了您的脚本,但它删除了所有记录......
    • 现在知道为什么循环会继续运行了。我尝试了您的脚本,但它删除了所有记录...让我解释一下:我设置了一个门户,使其像列表/购物车一样。以便用户可以将他们想要打印的记录添加到将在一个编号下归档的门户。添加添加到购物车按钮将记录/项目添加到门户。我试图复制发票在 FM 中的工作方式。你提到的脚本确实有效,但它不会为我的目的工作,因为它删除了门户所在的购物车表格\布局中的所有记录。
    • 你的回答让我的齿轮转动,这就是我所做的:我在列表下有一个 Portal 计数,它将显示列表/购物车中有多少项目,我在循环中添加了一个 if 语句一旦计数
    猜你喜欢
    • 2016-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-11
    • 2014-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多