I am displaying some markedonly records in a Form.
I want to prevent user from clicking the ShowALL buton.
Strangely i found that Filtergroup is not working for Markedonly records.
If you only need to show some records without that the user needs to change them, I would throw those records in a temptable and run the form with the temptable:
Some example (recTheTable is a record on the real table ; tmpTheTable is a temptable):
recTheTable.FINDSET;
REPEAT
IF Show the record THEN BEGIn
tmpTheTable := recTheTable;
tmpTheTable.INSERT(FALSE);
END;
UNTIL recTheTable.NEXT = 0;
FORM.RUNMODAL(0,tmpTheTable);
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
after filling the temporary form (kriki method), the user can modify the records (which are temporary).
You can create a function to flush your modified temptable to the real table. You can achieve this calling the function in the oncloseform (and/or under a button).
the only thing you have to do is to deny the permission to insert records to the user (or modify only the records that actually exists in the db, ignoring the others)
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
after filling the temporary form (kriki method), the user can modify the records (which are temporary).
You can create a function to flush your modified temptable to the real table. You can achieve this calling the function in the oncloseform (and/or under a button).
the only thing you have to do is to deny the permission to insert records to the user (or modify only the records that actually exists in the db, ignoring the others)
This is the correct way. It takes some more programming, but if they may not see other records. Or you have to find a filter that can be used.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
If you only need to show some records without that the user needs to change them, I would throw those records in a temptable and run the form with the temptable:
Some example (recTheTable is a record on the real table ; tmpTheTable is a temptable):
recTheTable.FINDSET;
REPEAT
IF Show the record THEN BEGIn
tmpTheTable := recTheTable;
tmpTheTable.INSERT(FALSE);
END;
UNTIL recTheTable.NEXT = 0;
FORM.RUNMODAL(0,tmpTheTable);
I try this code but it doesn't work. First findset doesn't exists in records and if a comment that, the system displays an error that the first variable current exists
global variables, focus your record variable, view, properties, temporary = yes
P.S.: you should study before programming...(assuming that you're doing this for a customer and not for personal training)
Until today I don't need to use this type of variable and if markonly doesn't have this problem I will continue.
And runmodal too, I have a question about it, I guess that 0 means that the system opens the default form for the record, in my case Item. But I need to open other and I change the number to the ID form but the system creates another object continuously. I don't know where to place the code to avoid that.
P.S.: It's for a customer. I didn't make an official Navision course, I don't need it for my job and I don't have time to do it. When I had a little time I try to learn something but nowadays the courses are e-learning mode. In that type of course I need a lot of time to learn something. I'm assuming that you're talking about specific Navision programming not general programming.
yes, i mean Navision programming for sure...but take it easy...i only suggested you to study nav programming in order to avoid errors...for example if you forgot a "temporary" property you can do a really big damage...inserting real records and so on...anyway, back to topic:
what do you mean with
but the system creates another object continuously
?
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
When i call runmodal the system inits another object and despite of that the system does again my code and calls again another object.
It's like this: run object -> run code (runmodal) -> run new object (like first one) -> run code -> (again and again)...
It's happens when I use runmodal with the ID of my form not with 0. With 0 works fine but opens form 31 not my form
let's say your form is no. 55555: do you do this in the onopenform of the form 55555?
recTheTable.FINDSET;
REPEAT
IF Show the record THEN BEGIn
tmpTheTable := recTheTable;
tmpTheTable.INSERT(FALSE);
END;
UNTIL recTheTable.NEXT = 0;
FORM.RUNMODAL(55555,tmpTheTable);
then, it's straightforward that your form will be called over and over...open -> runcode, rumodal -> open -> runcode.....
the code written by kriki is supposed to NOT be used in the onopenform, but for example in a codeunit.
In order to run this code in the onopenform you must be in version 5.00 (or 5.01, i don't remember), you'll find the property sourcetabletemporary for the form.
Search mibuso for "sourcetabletemporary", you should find threads about how to use it...
*EDIT: #-o you don't have FINDSET, you can't be in 5.0
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
Comments
Some example (recTheTable is a record on the real table ; tmpTheTable is a temptable):
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
But as you have already said that this is for viewing only.....
We actually want user to edit the records also.
Is there any solution for it ?
Thanks
You can create a function to flush your modified temptable to the real table. You can achieve this calling the function in the oncloseform (and/or under a button).
the only thing you have to do is to deny the permission to insert records to the user (or modify only the records that actually exists in the db, ignoring the others)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I try this code but it doesn't work. First findset doesn't exists in records and if a comment that, the system displays an error that the first variable current exists
P.S.: recTheTable MUST NOT be temporary
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Yes, it is a record over item table. I don't know how to create a temporary record.
P.S.: you should study before programming...(assuming that you're doing this for a customer and not for personal training)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Until today I don't need to use this type of variable and if markonly doesn't have this problem I will continue.
And runmodal too, I have a question about it, I guess that 0 means that the system opens the default form for the record, in my case Item. But I need to open other and I change the number to the ID form but the system creates another object continuously. I don't know where to place the code to avoid that.
P.S.: It's for a customer. I didn't make an official Navision course, I don't need it for my job and I don't have time to do it. When I had a little time I try to learn something but nowadays the courses are e-learning mode. In that type of course I need a lot of time to learn something. I'm assuming that you're talking about specific Navision programming not general programming.
what do you mean with ?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
It's like this: run object -> run code (runmodal) -> run new object (like first one) -> run code -> (again and again)...
It's happens when I use runmodal with the ID of my form not with 0. With 0 works fine but opens form 31 not my form
the code written by kriki is supposed to NOT be used in the onopenform, but for example in a codeunit.
In order to run this code in the onopenform you must be in version 5.00 (or 5.01, i don't remember), you'll find the property sourcetabletemporary for the form.
Search mibuso for "sourcetabletemporary", you should find threads about how to use it...
*EDIT: #-o you don't have FINDSET, you can't be in 5.0
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Yes, I'm working with a 4 version, can't I use sourcetabletemporary?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Object Manager
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Object Manager