Hi
I have a bool into a table and wanted the bool could only be marked in a single row of the table
I think this:
bool onvalidate()
thistable.RESET;
thistable.SETFILTER(thistable.Dietas,'Yes');
IF thistable.FINDFIRST THEN
thistable.bool := FALSE;
but this dont run... !!! HELP !!
0
Comments
bool onvalidate()
thistable.RESET;
thistable.SETFILTER(thistable.bool,'Yes');
IF thistable.FINDFIRST THEN
thistable.bool := FALSE;
am i right?:-k
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Yes, if you change the bool TRUE... another row change the bool false...
Sorry for my english
Now, i think on this function:
REPEAT
IF pT_Dimension.Dietas = TRUE THEN
pT_Dimension.Dietas := FALSE;
UNTIL pT_Dimension.NEXT = 0;
But:
1) If you are filtering to boolean, do not use string, use TRUE or FALSE isntead, and use SETRANGE instead SETFILTER (this is source of your problem, that the NAV is showing error about data type). Your code will not work under another language...
2) You are changing field, on which you are filtering - it have impact to performance and behaviour of the loop. Search for more info about this problem...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I filter by SETRANGE but the problem even there
If you try to only have one row at each given time to have 1 or 0 rows a true value then you could try this
which I now realise is the same answer as MBerger above
|To-Increase|
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
This code dont run because on the table dont have CurrForm :S
hey sory,i have tried this on form.
u can try without that line in table but i think the table wont update until you close it and open :-k
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
there is no way to update the table in real time ??
|To-Increase|
The same happens with the other code.
Bool is updated only when I open and close the table
The visual information is out of date.
You can refresh the table by: clicking on the lines, or opening and closing the table.
But better is to use a form: you can use statements like CurrForm.UPDATE to refresh the visual information.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav