在给定布局id的情况下,如何转到正确的filemaker布局



FileMaker快照文件有一个布局id。但是,使用转到布局编号并不能像我预期的那样工作。

Set Variable [$json; Value:Get(ScriptParameter)]
Set Variable [$layout_id; Value:JSONGetElement ( $json ; "UIState.Layout.@id" )]
Go to Layout [$layout_id] // layout number by calculation 
// ends up on a completely different layout than the one the snapshot file opens.

我发现布局id和布局编号是两个不同的数字。。。这就是进入布局编号脚本步骤失败的原因。

用作上述脚本参数的JSON字符串是.

{
"UIState": {
"UniversalPathList": "fmnet:/10.1.1.63/Balanced.fmp12nfmnet:/10.1.1.220/Balanced.fmp12nfmnet:/169.254.254.47/Balanced.fmp12nfilemac:/Macintosh HD/source/fmp16/Balanced.fmp12",
"Rows": {
"@rowCount": "1",
"@baseTableId": "131",
"#text": "21383239"
},
"Layout": {
"@id": "2"
},
"View": [
],
"SelectedRow": {
"@id": "21383239"
},
"StatusToolbar": {
"@visible": "True"
},
"Mode": {
"@value": "browseMode"
},
"SortList": {
"@Maintain": "True",
"@value": "False"
}
}
}

可以从命令行运行。示例

open 'fmp://filemaker.server/Balanced.fmp12?script=snapshot_link&param={ "UIState": { "UniversalPathList": "fmnet:/10.1.1.63/Balanced.fmp12nfmnet:/10.1.1.220/Balanced.fmp12nfmnet:/169.254.254.47/Balanced.fmp12nfilemac:/Macintosh HD/source/fmp16/Balanced.fmp12", "Rows": { "@rowCount": "1", "@baseTableId": "131", "#text": "21383239" }, "Layout": { "@id": "2" }, "View": [], "SelectedRow": { "@id": "21383239" }, "StatusToolbar": { "@visible": "True" }, "Mode": { "@value": "browseMode" }, "SortList": { "@Maintain": "True", "@value": "False" } } }'

在给定有效布局id的情况下,找到在FileMaker中显示的正确布局的好方法是什么?

我相信你可以通过在LayoutIDs函数返回的列表中找到给定布局ID的索引号来计算布局编号,比如=

Let ( 
listOfIDs = LayoutIDs ( "" ) 
;
ValueCount ( Left ( listOfIDs ; Position ( ¶ & listOfIDs & ¶ ; ¶ & $layout_ID & ¶ ; 1 ; 1 ) ) )
)

最新更新