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.
0
Answers
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
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?
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.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
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.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!