IF Record.FIELDACTIVE(Record.Field)=FALSE THEN
MESSAGE('This field enabled=false')
::Second
recref.OPEN(TableNo);
FOR Counter:=1 TO recref.FIELDCOUNT DO BEGIN
IF recref.FIELDEXIST(Counter) THEN BEGIN
fldref:=recref.FIELD(Counter);
IF fldref.ACTIVE THEN
MESSAGE('This field enabled=true %1',fldref.NUMBER)
ELSE
MESSAGE('This field enabled=false %1',fldref.NUMBER)
END;
END;
Enabled and editable are not the same thing.
Enabled dictates whether or not the field is actually allowed to be used at all (in effect it dictates that this field should be ignored completely).
I don't think you can tell whether or not a field is editable through C/AL code
but you can determine whether or not a control on a form is editable by using
[OK] := CurrForm.<Control Name>.EDITABLE([TRUE|FALSE]);
If you leave out the parameters then it returns the current status.
This isn't a signature, I type this at the bottom of every message
Comments
::First
IF Record.FIELDACTIVE(Record.Field)=FALSE THEN
MESSAGE('This field enabled=false')
::Second
recref.OPEN(TableNo);
FOR Counter:=1 TO recref.FIELDCOUNT DO BEGIN
IF recref.FIELDEXIST(Counter) THEN BEGIN
fldref:=recref.FIELD(Counter);
IF fldref.ACTIVE THEN
MESSAGE('This field enabled=true %1',fldref.NUMBER)
ELSE
MESSAGE('This field enabled=false %1',fldref.NUMBER)
END;
END;
This code is not tested, i think it works
Regards
Enabled dictates whether or not the field is actually allowed to be used at all (in effect it dictates that this field should be ignored completely).
I don't think you can tell whether or not a field is editable through C/AL code
but you can determine whether or not a control on a form is editable by using
[OK] := CurrForm.<Control Name>.EDITABLE([TRUE|FALSE]);
If you leave out the parameters then it returns the current status.
Description from help:
FIELDACTIVE (Record)
Use this function to check whether a field is enabled or not.
ACTIVE (FieldRef)
Use this function to check whether the field that is currently selected is enabled or not.
Both function is use to check is field ENABLED (not EDITABLE)