bcquality/microsoft/knowledge/style/no-space-before-method-parenthesis.md
Jesper Schulz-Wedde b6da405376 Improve partner onboarding and documentation navigation
Lead with a complete plugin quick start and add task-oriented usage, troubleshooting, customization, and contribution guides. Preserve the broader plugin framing, correct conflicting contract guidance, support Agents folder reviews, and align repository validation. Convert existing sample references to clickable links without changing knowledge rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 17:25:29 +02:00

1.3 KiB

bc-version domain keywords technologies countries application-area
all
style
spacing
parenthesis
method-call
aa0002
codecop
al
w1
all

No space between a method name and its opening parenthesis (CodeCop AA0002)

Description

CodeCop AA0002 forbids whitespace between a procedure/method name and its (. Customer.Get(CustomerNo) is correct; Customer.Get (CustomerNo) is not. The rule applies to user-defined procedures, system methods (Insert, FindFirst, CalcFields), trigger-style invocations, and the parenthesised cast/conversion forms (Format(Value), CopyStr(Source, 1, 10)). The whitespace between ( and the first argument, and between the last argument and ), is also forbidden by the same rule.

Best Practice

Customer.Get(CustomerNo), Customer.SetFilter("No.", '%1', '*A*'), Message(GreetingMsg, UserName). The standard AL formatter enforces this automatically.

See sample: no-space-before-method-parenthesis.good.al.

Anti Pattern

Customer.Get ( CustomerNo ), Message ( GreetingMsg, UserName ). Both trip AA0002 and read as if the call had an extra unnamed parameter — a small but persistent friction every reader pays.

See sample: no-space-before-method-parenthesis.bad.al.