Not sure what you want to do :?
do you want to do this through code or manually?
Manually: filter the field for <>''
Code: You can filter on the field <>'' and check the COUNT
hi Mr. DaveT,
actually my requirement is that i want a list of all field in tables that is blank(also that have default value for all data type) in a form of report or form by coding. so that i could find these are fields in those tables are blank.
eg..
table no. field no. field name
18 13707 T.I.N no
Is that so you can disable those fields and add more yourself? If so, be aware that when you disable fields, you essentially restrict your customer from ever using the functionality that is served by that field.
Code: You can filter on the field <>'' and check the COUNT
I would rather set filter using SETFILTER(Field,'<>%1', '') and then used ISEMPTY.
The code could look as below:
RecRef - variable of RecordRef type
fref - variable of FieldRef type
skipcheck - Boolean
RecRef.OPEN(18);
FOR i:= 1 TO RecRef.FIELDCOUNT DO BEGIN
Fref := RecRef.FIELDINDEX(i);
skipcheck := FALSE;
CASE FORMAT(Fref.TYPE) OF
'Code','Text' : Fref.SETFILTER('<>%1', '');
'Integer','BigInteger','Decimal', 'Option': Fref.SETFILTER('<>%1', 0);
'Date' : Fref.SETFILTER('<>%1', 0D);
'Time' : Fref.SETFILTER('<>%1', 0T);
'DateTime' : Fref.SETFILTER('<>%1', 0DT);
ELSE
skipcheck := TRUE;
END;
IF FORMAT(Fref.CLASS) <> 'Normal' THEN // skip Flowfields and Flowfilters
skipcheck := TRUE;
IF NOT skipcheck AND RecRef.ISEMPTY THEN BEGIN
// here you know that field referenced by Fref variable is empty
// in all records in ther table referenced by RecRef
MESSAGE('Empty %1 in table %2', Fref.CAPTION, RecRef.CAPTION);
END;
Fref.SETRANGE();
END;
recref.CLOSE();
The above allows you to find all empty fields in any table (in the example above table 18 Customer is checked).
hi Slawek Guzek,
thank you very much, but this code is not cover dateformula datatype that is generally used so if i want to do 4 it or what would be write instead of this like " Fref.SETFILTER('<>%1', 0DT);"
i have already maked it but the problem is only for datefurmula data type becoz there is no any fix value for this data type like 1m,15d,1w...etc...so i could be write any condition for it.
Comments
Not sure what you want to do :?
do you want to do this through code or manually?
Manually: filter the field for <>''
Code: You can filter on the field <>'' and check the COUNT
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
actually my requirement is that i want a list of all field in tables that is blank(also that have default value for all data type) in a form of report or form by coding. so that i could find these are fields in those tables are blank.
eg..
table no. field no. field name
18 13707 T.I.N no
RIS Plus, LLC
The code could look as below:
RecRef - variable of RecordRef type
fref - variable of FieldRef type
skipcheck - Boolean
The above allows you to find all empty fields in any table (in the example above table 18 Customer is checked).
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
thank you very much, but this code is not cover dateformula datatype that is generally used so if i want to do 4 it or what would be write instead of this like " Fref.SETFILTER('<>%1', 0DT);"
thanx in advance
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
viewtopic.php?f=23&t=36547