Markedonly records and Filtergroup

smkolsoft
Member Posts: 53
Dear All
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.
Pls advce me how to tackle this problem.
Thanks
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.
Pls advce me how to tackle this problem.
Thanks
0
Comments
-
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!0 -
Thanks kriki for your reply.
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 ?
Thanks0 -
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)0 -
Belias wrote: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)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote: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 exists0 -
If FINDSET doesn't exist it's because your version of Navision is to old. Use FIND('-') instead0
-
Now with FIND I can compile but the error continues, how can I create the temporary?0
-
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)0 -
Belias wrote: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.0 -
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 withbut the system creates another object continuously0 -
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 form0 -
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.00 -
I read the problem was in a form, I always thinking in that way.
Yes, I'm working with a 4 version, can't I use sourcetabletemporary?0 -
KTA8 wrote:I read the problem was in a form, I always thinking in that way.
Yes, I'm working with a 4 version, can't I use sourcetabletemporary?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Can I use another solution?0
-
The prevent your user to show all the records you can also put the filter back on in the OnAfterGetRecord trigger.
Form - OnAfterGetRecord() MARKEDONLY(TRUE);
Reijer Molenaar
Object Manager0 -
reijermolenaar wrote:The prevent your user to show all the records you can also put the filter back on in the OnAfterGetRecord trigger.
Form - OnAfterGetRecord() MARKEDONLY(TRUE);
0 -
KTA8 wrote:reijermolenaar wrote:The prevent your user to show all the records you can also put the filter back on in the OnAfterGetRecord trigger.
Form - OnAfterGetRecord() MARKEDONLY(TRUE);
0 -
I agree, it is much better to write some code in the OnFindRecord and OnNextRecord trigger.
Form - OnFindRecord(Which : Text[1024]) : Boolean tmpTheTable := Rec; tmpTheTable.SETVIEW(GETVIEW); IF tmpTheTable.FIND(Which) THEN BEGIN Rec := tmpTheTable; EXIT(TRUE); END; Form - OnNextRecord(Steps : Integer) : Integer tmpTheTable := Rec; tmpTheTable.SETVIEW(GETVIEW); CurrentSteps := tmpTheTable.NEXT(Steps); IF CurrentSteps <> 0 THEN BEGIN Rec := tmpTheTable; EXIT(CurrentSteps); END;
Reijer Molenaar
Object Manager0 -
Just put markedonly (true) in the onaftergetcurrentrecord0
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