Problem in Searching...

minty_friend
Member Posts: 38
Hi Experts,
I have created a form which shows marked only customers with their respective stores, but the problem is when I tried to insert a search filter, It wont work.
And when I try to Unmark all, All the customers vanishes(Reason the form is created in such a way that it shows only marked only customers)
Please suggest something....
I have created a form which shows marked only customers with their respective stores, but the problem is when I tried to insert a search filter, It wont work.
And when I try to Unmark all, All the customers vanishes(Reason the form is created in such a way that it shows only marked only customers)
Please suggest something....
0
Comments
-
What filters? Can you please give us a sample code you wrote?0
-
I use this code to setup marked only contacts:-
RetailSetup.GET;
Cont.RESET;
Cont.SETCURRENTKEY(Type);
Cont.SETRANGE(Type,Type::Company);
IF Cont.FIND('-') THEN REPEAT
CorpDisc.RESET;
CorpDisc.SETRANGE("Contact No.",Cont."No.");
CorpDisc.SETRANGE("Store No.",RetailSetup."Local Store No.");
IF CorpDisc.FINDFIRST THEN
Cont.MARK := TRUE;
UNTIL Cont.NEXT = 0;
Cont.MARKEDONLY(TRUE);
COPY(Cont);
and then i use this code to set search filter in the text box:=
SearchState := SearchState::Name;
IF SearchStr <> '' THEN BEGIN
IF COPYSTR(SearchStr,1,1) <> '*' THEN
SearchStr := '*' + SearchStr;
IF STRPOS(SearchStr,'*') > 0 THEN BEGIN
TreatAsFilter := TRUE;
IF COPYSTR(SearchStr,STRLEN(SearchStr),1) <> '*' THEN
SearchStr := SearchStr + '*';
END
ELSE
TreatAsFilter := FALSE;
END;
just take a look at the attached file, u will come to know about the actual problem:0 -
What are you trying to do and why?David Singleton0
-
Why dont you just make the filter on the SourceTableView property or OnOpenForm leaving the standard NAV search and filter functionality to do the job for you?
BR
Hawkeye0
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