Use parenthesis for method calls instead of assignment syntax

Properties
FC0005 Warning Design Code Fix Ignore Obsolete

The AL compiler lets you invoke a method that takes a single parameter using assignment syntax — Customer.ReadIsolation := IsolationLevel::ReadCommitted compiles just like Customer.ReadIsolation(IsolationLevel::ReadCommitted). Written as an assignment, a method call is visually indistinguishable from setting a value, hiding the fact that a method is being invoked.

Example

procedure UpdateCustomer(var Customer: Record Customer)
var
    CustomerMgt: Codeunit "Customer Mgt.";
begin
    // Looks like assigning a value, but actually calls a method
    Customer.ReadIsolation := IsolationLevel::ReadCommitted; // Use parenthesis for method calls [FC0005]

    // Also applies to user-defined procedures
    CustomerMgt.SetValue := 5;
end;

Call the method using parenthesis instead:

procedure UpdateCustomer(var Customer: Record Customer)
var
    CustomerMgt: Codeunit "Customer Mgt.";
begin
    // The method call is now explicit
    Customer.ReadIsolation(IsolationLevel::ReadCommitted);

    CustomerMgt.SetValue(5);
end;

Why this matters

When the target of an assignment resolves to a method that takes exactly one parameter, the AL compiler rewrites Target := Source into Target(Source) — an actual method call. Both forms produce the same InvocationExpression, but the assignment form reads like a property assignment.

Today the AL Language does not have properties on objects, so the compiler lets you get away with the assignment form. If AL ever introduces real properties, a statement like MyObject.Value := 5 becomes ambiguous — is it assigning a property or calling a method? By always calling methods with parenthesis you make the intent unambiguous, both for tooling and for anyone reading your code.

This rule is the assignment-syntax counterpart of FC0003 , which covers method calls written without parenthesis (Customer.IsEmpty).