Filtering question
 
            
                
                    bangswit                
                
                    Member Posts: 265                
            
                        
            
                    how to filter more than 1?
how to change this code to be 1 variable??
SETFILTER("No.",'%1|%2|%3','ITEM05','ITEM06','ITEM07');
i made this, but failed
ItemText := 'ITEM05|ITEM06|ITEM07';
SETFILTER("No.",'%1',ItemText);
                how to change this code to be 1 variable??
SETFILTER("No.",'%1|%2|%3','ITEM05','ITEM06','ITEM07');
i made this, but failed
ItemText := 'ITEM05|ITEM06|ITEM07';
SETFILTER("No.",'%1',ItemText);
0                
            Comments
- 
            I use this all the time
 POLine.SETFILTER("Document No.",POHdrFilter);
 Where POHdrFilter is 'PO1|PO2|PO3|PO4'
 I don't think you need the %1 in this usage.
 Steve0
- 
            
 thanks SteveSPost29 wrote:I use this all the time
 POLine.SETFILTER("Document No.",POHdrFilter);
 Where POHdrFilter is 'PO1|PO2|PO3|PO4'
 I don't think you need the %1 in this usage.
 Steve
 by the way, do you know how to delete the latest character from variable?
 like this text --> 'PO1|PO2|PO3|PO4'
 it would be 'PO1|PO2|PO3|PO'0
- 
            bangswit wrote:do you know how to delete the latest character from variable?
 like this text --> 'PO1|PO2|PO3|PO4'
 it would be 'PO1|PO2|PO3|PO'
 You can use function COPYSTR. Take a look at the help for details on how it works.
 Salut!
 Laura NicolàsLaura Nicolàs
 Author of the book Implementing Dynamics NAV 2013
 Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0
- 
            ok
 just like this
 COPYSTR(ItemVar,1,STRLEN(ItemVar)-1)
 thanks everyone0
- 
            
 you don't only not need it, but it changes the logic.SPost29 wrote:I use this all the time
 POLine.SETFILTER("Document No.",POHdrFilter);
 Where POHdrFilter is 'PO1|PO2|PO3|PO4'
 I don't think you need the %1 in this usage.SETFILTER("No.",'%1','ITEM05|ITEM06|ITEM07');is not identical toSETFILTER("No.",STRSUBSTNO('%1','ITEM05|ITEM06|ITEM07'));but rather treats the 2nd Parameter as a filter and then, after it has parsed that filter, replaces any filter value that consists only of a "replacement field" (%1, %2 ...) with the corresponding value parameter.
 So in the example above, the filter string is parsed to consist of one single value (there are no filter operators in the string '%1'). Then the third parameter is used as that single value. The fact, that this value looks like a filter string is not taken into consideration.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
- 322 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


