You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by the How to use Interfaces in BC - The BC Coding Stream / Business Central Development; When an Enum object implements an interface and the Extensible property is set to True, the rule checks whether the DefaultImplementation or UnknownValueImplementation property is present. If either of these properties is missing, then then raise a diagnostic (maybe best to implement this through two separate rules).
enum50100 Vehicles implements Vehicle
{
DefaultImplementation = Vehicle = EmptyVehicle; // Raise diagnostic when this property is not set
Extensible = true;
UnknownValueImplementation = Vehicle = EmptyVehicle; // Raise diagnostic when this property is not setvalue(0; " ")
{
Caption = '', Locked = true;
}
value(1; "Car")
{
Caption = 'Car';
Implementation = Vehicle = Car;
}
}
interface Vehicle { }
codeunit50100 EmptyVehicle implements Vehicle { }
codeunit50101 Car implements Vehicle { }
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Inspired by the How to use Interfaces in BC - The BC Coding Stream / Business Central Development; When an Enum object implements an interface and the
Extensible
property is set toTrue
, the rule checks whether theDefaultImplementation
orUnknownValueImplementation
property is present. If either of these properties is missing, then then raise a diagnostic (maybe best to implement this through two separate rules).Beta Was this translation helpful? Give feedback.
All reactions