Replies: 2 comments 1 reply
-
@rvanbekkum Any input / ideas on this one (to make it somewhat more generic for other properties)? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I like the idea of a warning if certain fields are not defined correctly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Business Central contains several patterns for defining fields (ShortCut Dimension, DimensionSet, County, Unit Price, Amounts, ...). These always share a similar set of properties. We could imagine the developer using some snippets that contain the boilerplate code, but snippets are not mandatory to use.
Most common properties are set by the developer (TableRelation, field length, DecimalPlaces, ...), but what is e.g. often forgotten is the use of the CaptionClass.
Some Base App examples:
What might be useful, is to maintain a list (maybe already including some standards shipped via LinterCop) of field (regex) patterns that should have at least the captionClass property.
We recently stumbled upon not setting the CaptionClass for County fields, so having a regex to identify
field(xxx; xxx County xxx; Text[30])
fields would be nice.Not only is (part of ) the field name important, the fieldtype is important too. I don't want fields
'Show County'; Boolean
to be included as part of the rule.Ideally, we should be able to maintain the list of fields in the settings.json, since we adopt this pattern a lot of our custom fields.
E.g. volume, weight, dimensions, ... always receive a Unit in our add-on.
PS: CaptionClass is the one we often forget, but there are other properties too that are shared amongst field definitions (e.g. Unit Price / Amount fields, ...) Not sure if the CaptionClass rule should be considered as a separate rule, or should be looked from a broader perspective... (eventually ending up that a 'Customer No.' field should have a 'Customer' tablerelation ... ? :()
Beta Was this translation helpful? Give feedback.
All reactions