PlatformCop

PlatformCop inspects AL code for constructs the platform rejects, ignores, or executes differently from what the code says. Ignoring a PlatformCop rule gives a runtime error or code that silently does nothing: an AutoIncrement field in a temporary table, a filter operator inside SetRange. The rules apply to any AL code, independent of the Business Central application it runs in. See how the analyzers differ for the split between PlatformCop, ApplicationCop and LinterCop.

Rules

IDTitleSeverityEnabledCode Fix
PC0001FlowFields should not be editableWarning✓✓
PC0002AutoIncrement fields are not supported in temporary tablesError✓
PC0003Filter operators should not be used in SetRangeError✓✓
PC0004List objects are one-basedError✓
PC0005Explicitly set Extensible property on public objectsHidden✓
PC0006Every object needs to specify a value for the Access propertyHidden
PC0007AutoCalcFields should only be used for FlowFields or Blob fieldsError✓
PC0008Avoid unsupported operators with placeholders in SetFilter expressionsError✓✓
PC0010Event subscriber var keyword mismatchWarning✓✓
PC0011Handled parameters in event signatures should be passed by varWarning✓✓
PC0012Set values for FlowFilter fields using filtering methodsWarning✓
PC0013Record.Get procedure argumentsError✓
PC0014Use two single quotes instead of double quotes in JPath expressionsWarning✓✓
PC0015Guid empty string comparisonError✓✓
PC0016Clear/ClearAll does not reset SingleInstance codeunit stateWarning✓
PC0017Page record argument does not match source tableWarning✓
PC0018Page record methods require a SourceTableError✓
PC0019Invalid single-quote escaping in filter stringWarning✓✓
PC0020Incompatible field types across TransferFieldsWarning✓
PC0021Inconsistent field names across TransferFieldsWarning✓
PC0022Possible overflow assigningWarning✓✓
PC0023IsHandled parameter assignmentWarning✓
PC0024ApplicationArea property is not applicable to API pagesInfo✓✓
PC0025ODataKeyFields should use SystemIdError✓
PC0026Mandatory field missing on API pageWarning✓✓
PC0027Avoid triggering table logic on temporary recordsWarning✓
PC0028Table relation field length mismatchWarning✓
PC0029Use CreateSequentialGuid for key fieldsInfo✓✓
PC0030Use partial records on read operationInfo✓✓
PC0031Partial records cause JIT load on full-field operationsWarning✓✓
PC0032Report layout property exceeds maximum lengthError✓
PC0033Duplicate OData EntityName on page controlsWarning✓
PC0034Placeholder argument count mismatchWarning✓
PC0035Use SetAutoCalcFields for loopsWarning✓✓
PC0036SetRecord() does not support temporary recordsWarning✓
PC0037Use Validate() instead of direct field assignmentWarning✓✓
PC0038Not all code paths return a valueInfo✓