how can i find blank field in table
vijay_g
Member Posts: 884
hi,
can anybody tell me that how can i find any table fields that not have value means that is blank with all records.
can anybody tell me that how can i find any table fields that not have value means that is blank with all records.
0
Comments
-
Hi,
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 COUNT0 -
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 no0 -
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.0
-
I would rather set filter using SETFILTER(Field,'<>%1', '') and then used ISEMPTY.DaveT wrote:Code: You can filter on the field <>'' and check the COUNT
The code could look as below:
RecRef - variable of RecordRef type
fref - variable of FieldRef type
skipcheck - BooleanRecRef.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).Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
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);"
thanx in advance0 -
Sorry. That is puzzle to solve by you. Learn, don't copy only.vijay_g wrote:what would be write instead of this like " Fref.SETFILTER('<>%1', 0DT);"Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
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.0
-
Do you make it right, it works too!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

