microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
744 stars 245 forks source link

Runtime error on Calcsums in combination with flowfields. (Compiler does not fail) #6911

Closed fvet closed 2 years ago

fvet commented 2 years ago

Retested and re-opened #6160 since still present in the latest version:


Copy of original post #6160

Describe the bug When adding a rec.calcsums(rec.Flowfield1, rec.Flowfield2) in AL, the compiler does not fail. Only a runtime errors occurs when the modern client is used.

To Reproduce

Message:
  The following SQL error was unexpected:
  Invalid column name 'Weight'.
  Invalid column name 'Volume'.
  Invalid column name 'Loading Length'.
  Statement(s) could not be prepared.
  SQL statement:
  SELECT SUM("2002963"."Weight"),SUM("2002963"."Volume"),SUM("2002963"."Loading Length") FROM "W1DEV_AL_FVET".dbo."NVT Route Detail$0d6519c0-93fa-42a6-9b69-49ed3fb5fa66" "2002963"  WITH(UPDLOCK)  WHERE ("Trip No_"=@0 AND "Partial trip Line No_"=@1 AND "Route Line No_"=@2) OPTION(OPTIMIZE FOR UNKNOWN)

Expected behavior The AL compiler should fail on CALCSUMS statement in combination with flowfields.

5. Versions:

image

Version: W1 16.3 (Platform 16.0.14073.14195

mazhelez commented 2 years ago

Thanks for reporting this issue. Sorry we haven’t completed it yet, but we’ve had to prioritize elsewhere. We’re planning to give the CodeCop engine and its rules an overhaul in a future major release. Thanks for your patience.