Skip to content

Commit 3e00100

Browse files
Arthurvdvclaude
andauthored
docs(AC0031, AC0032): describe flow-sensitive DataTransfer SetTables pairing (#159)
The tables a CopyRows/CopyFields call needs now come from the SetTables on the same variable that reaches the call in the same procedure or trigger: a later SetTables replaces an earlier one, branches that configure different tables all count, and a SetTables can reach a call through a loop's next iteration. Unresolvable cases (no reaching SetTables, non-literal table arguments) are still not reported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a366f23 commit 3e00100

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

content/docs/analyzers/ApplicationCop/AC0031.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ codeunit 50100 "Upgrade Purch. Cr. Memo Line"
117117
}
118118
{{< /highlight >}}
119119

120-
The tables are resolved from every `SetTables` call on the same `DataTransfer` variable **in the same procedure or trigger** as the `CopyFields`/`CopyRows` call, and only when both arguments are `Database::"Table Name"` literals. When several `SetTables` calls exist in that body, all of their tables are considered — provided every one of them resolves; a single `SetTables` with a non-literal argument makes the whole call unresolvable. The variable itself may be a local, a global (also when addressed as `this.MyDataTransfer`), or a parameter.
120+
The tables come from the most recent `SetTables` call on the same `DataTransfer` variable that reaches the `CopyFields`/`CopyRows` call **in the same procedure or trigger**, and only when both arguments are `Database::"Table Name"` literals. A later `SetTables` replaces the earlier one, so a variable that is reconfigured between copies charges each call only for the tables it actually transfers. When branches (`if`, `case`) set different tables before the call, all of those tables count, and so does a `SetTables` that only reaches the call through a loop's next iteration. The variable itself may be a local, a global (also when addressed as `this.MyDataTransfer`), or a parameter.
121121

122-
When the tables cannot be determined — no `SetTables` in the same body (for example, configured in another procedure or by the caller), or an argument that is a variable, parameter, or expression instead of a `Database::` literal — no diagnostic is reported for that call.
122+
When the tables cannot be determined — no `SetTables` reaching the call in the same body (for example, configured in another procedure or by the caller), or an argument that is a variable, parameter, or expression instead of a `Database::` literal — no diagnostic is reported for that call.
123123

124124
### Exceptions
125125

content/docs/analyzers/ApplicationCop/AC0032.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ codeunit 50100 "Upgrade Purch. Cr. Memo Line"
166166
}
167167
{{< /highlight >}}
168168

169-
The tables are resolved from every `SetTables` call on the same `DataTransfer` variable **in the same procedure or trigger** as the `CopyFields`/`CopyRows` call, and only when both arguments are `Database::"Table Name"` literals. When several `SetTables` calls exist in that body, all of their tables count as used — provided every one of them resolves; a single `SetTables` with a non-literal argument makes the whole call unresolvable. The variable may be a local, a global (also when addressed as `this.MyDataTransfer`), or a parameter.
169+
The tables come from the most recent `SetTables` call on the same `DataTransfer` variable that reaches the `CopyFields`/`CopyRows` call **in the same procedure or trigger**, and only when both arguments are `Database::"Table Name"` literals. A later `SetTables` replaces the earlier one, so only the tables a given call actually transfers count as used by it — permissions granted for a table that some *other* copy in the same procedure transfers are still reported as unused. When branches (`if`, `case`) set different tables before the call, all of those tables count, and so does a `SetTables` that only reaches the call through a loop's next iteration. The variable may be a local, a global (also when addressed as `this.MyDataTransfer`), or a parameter.
170170

171-
When the tables cannot be determined — no `SetTables` in the same body (for example, configured in another procedure or by the caller), or an argument that is a variable, parameter, or expression instead of a `Database::` literal — the operation may target any table, and AC0032 is disabled for the entire object, exactly as for `RecordRef` operations above.
171+
When the tables cannot be determined — no `SetTables` reaching the call in the same body (for example, configured in another procedure or by the caller), or an argument that is a variable, parameter, or expression instead of a `Database::` literal — the operation may target any table, and AC0032 is disabled for the entire object, exactly as for `RecordRef` operations above.
172172

173173
### Temporary tables
174174

0 commit comments

Comments
 (0)