{"title":"AppSourceCop Hidden AS0138","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0138/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0138, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0138","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Table fields should use the AllowInCustomizations property and its value must be different from ToBeClassified and Always.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Hidden AS0138","slug":"appsourcecop-hidden-as0138","at":0,"chars":2557},{"level":2,"title":"Description","slug":"description","at":88,"chars":269},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":357,"chars":382},{"level":2,"title":"Code examples triggering the rule","slug":"code-examples-triggering-the-rule","at":739,"chars":600},{"level":3,"title":"Example 1 - AllowInCustommizations not specified","slug":"example-1---allowincustommizations-not-specified","at":776,"chars":234},{"level":3,"title":"Example 2 - AllowInCustommizations set to disallowed value","slug":"example-2---allowincustommizations-set-to-disallowed-value","at":1010,"chars":329},{"level":2,"title":"Code examples not triggering the rule","slug":"code-examples-not-triggering-the-rule","at":1339,"chars":1067},{"level":3,"title":"Example 1 - AllowInCustomizations specified on field level","slug":"example-1---allowincustomizations-specified-on-field-level","at":1380,"chars":315},{"level":3,"title":"Example 2 - AllowInCustomizations specified on table level","slug":"example-2---allowincustomizations-specified-on-table-level","at":1695,"chars":320},{"level":3,"title":"Example 3 - AllowInCustomizations specified on table extension level","slug":"example-3---allowincustomizations-specified-on-table-extension-level","at":2015,"chars":391},{"level":2,"title":"Related information","slug":"related-information","at":2406,"chars":151}],"text":"# AppSourceCop Hidden AS0138\nTable fields should use the AllowInCustomizations property\n## Description\nTable fields should use the AllowInCustomizations property and its value must be different from ToBeClassified and Always. From runtime 16.0, you can specify on the application object level the AllowInCustomizations to use as default for all its fields.\n## How to fix this diagnostic?\nTo resolve this diagnostic, specify the AllowInCustomizations property on either the field level, the table level, or table extension level, and ensure that the value is not set to ToBeClassified or Always. See https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/analyzers/..\\properties\\devenv-allowincustomizations-property.\n## Code examples triggering the rule\n### Example 1 - AllowInCustommizations not specified\nThe AllowInCustomizations property is missing on the field, which triggers the rule:\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(1; MyField; Integer) { }\n    }\n}\n```\n### Example 2 - AllowInCustommizations set to disallowed value\nThe AllowInCustomizations property is set to ToBeClassified, which triggers the rule:\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(1; MyField; Integer)\n        {\n            AllowInCustomizations = ToBeClassified; // Not allowed.\n        }\n    }\n}\n```\n## Code examples not triggering the rule\n### Example 1 - AllowInCustomizations specified on field level\nHere, the field explicitly specifies `AllowInCustomizations = AsReadOnly;`, which is valid:\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(1; MyField; Integer)\n        {\n            AllowInCustomizations = AsReadOnly;\n        }\n    }\n}\n```\n### Example 2 - AllowInCustomizations specified on table level\nHere, the table sets the property, which applies to all fields by default:\n```al\ntable 50100 MyTable\n{\n    AllowInCustomizations = AsReadWrite;\n\n    fields\n    {\n        field(1; MyField; Integer) { }\n        field(2; MyOtherField; Integer) { }\n    }\n}\n```\n### Example 3 - AllowInCustomizations specified on table extension level\nHere, the table extension sets the property, which applies to all fields within this object:\n```al\ntableextension 50100 MyTableExt extends Customer\n{\n    AllowInCustomizations = AsReadWrite;\n\n    fields\n    {\n        field(50100; MyExtField; Integer) { }\n        field(50101; MyOtherExtField; Integer) { }\n    }\n}\n```\n## Related information\nAppSourceCop analyzer<appsourcecop>\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>"}