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....
0
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
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:
BR
Hawkeye