SetSelectionFilter and temporary Records
Schwarz
Member Posts: 8
Hello,
i tried to use the Currform.Setselectionfilter Function in a form with temporary records. Looks like that on temporary records this function
doesnt work
Did someone have some experience with this behaviour or are there some possible workarounds to use the SetselectionFilter Function.
Thanks for your help in advantage.
Regards.
i tried to use the Currform.Setselectionfilter Function in a form with temporary records. Looks like that on temporary records this function
doesnt work
Did someone have some experience with this behaviour or are there some possible workarounds to use the SetselectionFilter Function.
Thanks for your help in advantage.
Regards.
0
Comments
-
Add a new boolean field called Select. The user will then check the records he wants to select. and you can then filter on that field.0
-
Hello ara3n,
of cource thats a possible solution and i was thinking about this, but using SetSelectionfilter is a more "Windows like" style and some customers prefer this way.
I use Setselectionfilter in several cases and it works fine, i didnt thouht that it doesnt work with temporary records.
Using the Record mark is another way to solve the problem. But there are some problems using Citrix (which can be solved..)
Regards,
Frank0 -
Yes temp records have some limitations and Navision never fully implemented all of the features of a regular record.0
-
I've just actually found this problem with temporary records. I was doing a little test here at home when a colleague of mine was having problems getting it to work. So, I just wrote this:
OBJECT Table 51000 testing { OBJECT-PROPERTIES { Date=14/11/06; Time=20:35:21; Modified=Yes; Version List=; } PROPERTIES { } FIELDS { { 1 ; ;num ;Integer } { 2 ; ;testing ;Integer } { 3 ; ;testing2 ;Integer } } KEYS { { ;num } } CODE { BEGIN END. } } OBJECT Form 51000 testinglauncher { OBJECT-PROPERTIES { Date=14/11/06; Time=22:24:13; Modified=Yes; Version List=; } PROPERTIES { Width=2200; Height=550; } CONTROLS { { 1000000000;CommandButton;0;0 ;2200 ;550 ;Name=Launch; OnPush=BEGIN FORM.RUNMODAL(FORM::testing,testinger) END; } } CODE { VAR testinger@1000000000 : TEMPORARY Record 51000; BEGIN END. } } OBJECT Form 51001 testing { OBJECT-PROPERTIES { Date=14/11/06; Time=22:39:49; Modified=Yes; Version List=; } PROPERTIES { Width=6710; Height=4400; SourceTable=Table51000; OnOpenForm=VAR c@1000000000 : Integer; BEGIN DELETEALL; FOR c := 0 TO 100 DO BEGIN INIT; num := c; testing := c * 2; testing2 := c * 5; INSERT; END; END; } CONTROLS { { 1000000000;TableBox;220 ;110 ;6270 ;3520 } { 1000000002;TextBox;0 ;440 ;1700 ;440 ;ParentControl=1000000000; InColumn=Yes; SourceExpr=num } { 1000000003;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000002; InColumnHeading=Yes } { 1000000004;TextBox;1376 ;440 ;1700 ;440 ;ParentControl=1000000000; InColumn=Yes; SourceExpr=testing; OnActivate=BEGIN recr.GETTABLE(Rec); fieldr := recr.FIELD(Rec.FIELDNO(testing)); END; } { 1000000005;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000004; InColumnHeading=Yes } { 1000000006;TextBox;3837 ;330 ;1700 ;440 ;ParentControl=1000000000; InColumn=Yes; SourceExpr=testing2; OnActivate=BEGIN recr.GETTABLE(Rec); fieldr := recr.FIELD(Rec.FIELDNO(testing2)); END; } { 1000000007;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000006; InColumnHeading=Yes } { 1000000001;CommandButton;220;3740;2200;550;Name=But; OnPush=VAR i@1000000001 : Integer; pap@1000000002 : Record 51000; c@1000000003 : Integer; trecr@1000000005 : RecordRef; tfieldr@1000000004 : FieldRef; BEGIN CurrForm.SETSELECTIONFILTER(pap); pap.MARKEDONLY(TRUE); IF NOT pap.FINDFIRST THEN BEGIN i := fieldr.VALUE; i *= 2; fieldr.VALUE(i); recr.MODIFY; END ELSE BEGIN REPEAT trecr.GETTABLE(pap); FOR c := 2 TO 3 DO BEGIN tfieldr := trecr.FIELD(c); i := tfieldr.VALUE; i *= 2; tfieldr.VALUE(i); trecr.MODIFY; END; UNTIL pap.NEXT = 0; END; END; } } CODE { VAR recr@1000000000 : RecordRef; fieldr@1000000001 : FieldRef; BEGIN END. } }
When testinger at the end of Form 51000 is set as not being TEMPORARY, the SETSELECTIONFILTER works fine, when TEMPORARY however, it simply will not enter the part of the code that deals with a selected line. The SETSELECTIONFILTER simply returns nothing.
It's all a bit strange IMO, because the form is working totally with Rec, it's not a workaround dealing with OnFindRecord or OnNextRecord manually, the TEMPORARY Record is declared in the calling form. The actual addressing of the table data really should not matter, it should be going through exactly the same function set as if it were in the database, surely this is wrapped up. It doesn't however.
Is there any other was of knowing which line is selected? I think that it's impossible without workarounds such as Bool checkboxes. Real shame.0 -
Yep I was doing this a few days ago to see if they've changed anything in 4.0 sp3 and ran into the same problem. I'm afraid you still need to add a boolean. The other option is to add a GUID to the Primary key and insert the records into the table.0
-
Are we sure the reason for this is because they haven't implemented it fully? Could it not simply be a bug that they are unaware of?0
-
Yes of course it's a bug, you can try to ask MS. But I don't know if you'll get anywhere. If there is a workaround, it's not critical and they won't fix it. Specially now that we will have a new client in v. 5.0.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 327 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
