SETSELECTIONFILTER : add selected records to another form

LeoNav
Member Posts: 55
Hi, 
I have a form 01 with a field allowing me to select a record (but only one at a time) from an other form 02. I try tu use the SETSELECTIONFILTER function in order to select multiple values at a time but it doesn't work. I only have the record which the cursor is on.
I use a button and put this code on it (OnPush trigger) :
I read a lot of posts on it on Mibuso but I can't solve my problem.
An idea ?

I have a form 01 with a field allowing me to select a record (but only one at a time) from an other form 02. I try tu use the SETSELECTIONFILTER function in order to select multiple values at a time but it doesn't work. I only have the record which the cursor is on.
I use a button and put this code on it (OnPush trigger) :
CurrForm.SETSELECTIONFILTER(SelectionTest); IF SelectionTest.FINDSET THEN REPEAT MESSAGE('message test'); UNTIL NEXT = 0;
I read a lot of posts on it on Mibuso but I can't solve my problem.
An idea ?
0
Comments
-
LeoNav wrote:Code: Select all
CurrForm.SETSELECTIONFILTER(SelectionTest);
IF SelectionTest.FINDSET THEN
REPEAT
MESSAGE('message test');
UNTIL NEXT = 0;
Is this how it is written?
If so try the following:
CurrForm.SETSELECTIONFILTER(SelectionTest);
IF SelectionTest.FINDSET THEN
REPEAT
MESSAGE('message test');
UNTIL SelectionTest.NEXT = 0;0 -
maybe you should try
UNTIL Selectiontest.NEXT = 0
0 -
Ok, it work.
But I have an other problem. EvenIf I select many values, I only have one that is added the the form 02 when I push on the button.0 -
I think we need to see the rest of the code for this. Maybe it is outside the loop?0
-
For the moment, I have nothing else inside the loop than the message. I don't know how to select these records and add it to the form01.0
-
Hello,
I tried your code and it worked fine. So that makes me think maybe the problem is how you are selecting the records...
First, you will need a list form of some sort. Then, select the records you want by holding down either the SHIFT or CTRL key. They will be highlighted in blue. Then click on the button. You should see a test message for every record you have selected.
If you do not highlight multiple records before running the code, it will only give you one test message, for the currently selected record, like you said.0 -
Yes, now it's ok. I can have a multiple selection. Thanks you all for your help.
LeoNav0 -
Hi,
I have this error "Copying all filters at once can only be done etwwen records beloinging to the same table" when I compile this code on my form :CLEAR(F_JobList); F_JobList.SETTABLEVIEW(Job); F_JobList.SETRECORD(Job); F_JobList.LOOKUPMODE(TRUE); IF F_JobList.RUNMODAL = ACTION::LookupOK THEN BEGIN Cpt:=0; CurrForm.SETSELECTIONFILTER(Job); IF Job.FINDSET THEN REPEAT Cpt:=Cpt+1; MESSAGE('%1',Cpt); T_Eligible56204.INIT; T_Eligible56204."Qualification Code" :=Rec.Code; T_Eligible56204.Type := T_Eligible56204.Type::Job; T_Eligible56204.Code := Job."No."; T_Eligible56204.Name := Job.Description; T_Eligible56204.INSERT; UNTIL Job.NEXT = 0; END;
An idea ?0 -
Nobody has a idea ?0
-
what is this..
CurrForm.SETSELECTIONFILTER(Job);
what is job here?0
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