Visible property of a column on a page

siimsand
Member Posts: 28
Hello!
I have these fields in a group (on a page) Field1, Field2, Field3, ... . They make up columns in a factbox. Field1 is an option type field with options 1, 2, 3, ... . I want to set the visibility of the Field1 to FALSE by default and the initial value in case a new entry is made for Field1 to option 1. I've done:
OnInsertRecord(BelowxRec : Boolean) : Boolean
Field1 := Field1::Option1; //this sets the Field1 value to Option1 after an entry is made (a new record entered)
Can't quite seem to figure out the code for changing the visibility to TRUE if and entry is made (a new record entered). Any help?
Thanks in advance.
I have these fields in a group (on a page) Field1, Field2, Field3, ... . They make up columns in a factbox. Field1 is an option type field with options 1, 2, 3, ... . I want to set the visibility of the Field1 to FALSE by default and the initial value in case a new entry is made for Field1 to option 1. I've done:
OnInsertRecord(BelowxRec : Boolean) : Boolean
Field1 := Field1::Option1; //this sets the Field1 value to Option1 after an entry is made (a new record entered)
Can't quite seem to figure out the code for changing the visibility to TRUE if and entry is made (a new record entered). Any help?
Thanks in advance.
0
Best Answer
-
"Set visibility to FALSE by default" means it will be FALSE on opening the page, an after inserting a new record it will be TRUE until the page is closed. It could be 3 seconds or could be 8 hours. If it works for you then, yes, it is easy. Just make a global boolean var, assign Visibility of your column to that var, and set the var to TRUE in the OnInsert trigger on the page.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
For how long new record is a new record? If you insert it and milliseconds after NAV will read it is it still considered a new record?Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek_Guzek wrote: »For how long new record is a new record? If you insert it and milliseconds after NAV will read it is it still considered a new record?
I rather thought that if the whole row is filled with random data, aka when a new entry is made. Is the time really important here? Or the fact that a new row (entry, record) is made?0 -
It is, at least in my opinion.
You could, for example, add a global Var NewRec on the page, set it to TRUE in in OnInsert and reset it in OnAfterGetRecord. Then you could use this global var in the Visible property. But if the two happens almost immediately one after another (which is what really happens, refreshing visibility on the screen is tightly linked with refreshing records) then such a 'show when new' logic will not work. I mean it will but no one will be able to see the effects.
Personally I'd rather try not to work on 'time basis' - is 'new' - is 'not new' condition, but I would try to come up with some different condition/rules when to show the field/column.
Time-based conditions are much more tricky to code than you would initially think.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek_Guzek wrote: »It is, at least in my opinion.
You could, for example, add a global Var NewRec on the page, set it to TRUE in in OnInsert and reset it in OnAfterGetRecord. Then you could use this global var in the Visible property. But if the two happens almost immediately one after another (which is what really happens, refreshing visibility on the screen is tightly linked with refreshing records) then such a 'show when new' logic will not work. I mean it will but no one will be able to see the effects.
Personally I'd rather try not to work on 'time basis' - is 'new' - is 'not new' condition, but I would try to come up with some different condition/rules when to show the field/column.
Time-based conditions are much more tricky to code than you would initially think.
Okay, so you're basically saying doing this is very complicated? The concept seems pretty simple. Set the visibility of the property to FALSE by default and simply to TRUE again with an initial value once a new row is entered with some data.0 -
"Set visibility to FALSE by default" means it will be FALSE on opening the page, an after inserting a new record it will be TRUE until the page is closed. It could be 3 seconds or could be 8 hours. If it works for you then, yes, it is easy. Just make a global boolean var, assign Visibility of your column to that var, and set the var to TRUE in the OnInsert trigger on the page.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 320 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