Well, I have have build it in customers app browse for products. They have 29.000 products in it ( for my type of customers that are a lot of records) and that works fast.
This is standard behavior for the “filtered” locator and for the incremental locator as well.
But be aware that you DON’T CLICK on the search field before typing, just type when you’re in the browse, then the browse will react right away on what you type.
Many users see the search field (locator) and they will click on it and type, but then they need to use to Tab to go back to the browse and get a reaction. So don’t do that.
My locator fields have the SKIP attribute set, so it goes to the browse right away when the screen opens.
I wrote: “now when you begin typing in the locator field the selector moves while you type” works for me, all those years. But, when the column (field) in the browse is a numeric (long)…it works different. When the field (column) is String it works like I wrote, but if it’s a long I have to fill the whole numeric value I search for.
for instance if I want to locate 30557 and type in 3 it does not jump to the first 3 and have to type the whole number 30557 before it jumps to that line in the browse
BTW the locator is a local field Cstring
If the number is always 5 digits you should be able to make it work by appending zeros to the right side of the string then convert to number.
I know I have done this for a Tax ID ( SSN, ITIN, FEIN) that is always 9 digits and was stored in a LONG. Type 4 and it locates on 400000000, type 46 and it locates on 460000000, 461 -> 461000000 etc
My Super Browse templates include a DisplayLocator control template, which shows the current contents of the locator (whatever type you’re using). It’s most useful with Incremental and Filter. Your users don’t even have to click on the locator field: they can just type in the browse as they normal would do.
Carl: almost done does not work completely
my CUS:Number is a LONG (@N_10) and the locator is a string 10.
please can you look at it one more time ? Thanks
For this to work the Number of Digits in the code has to be FIXED i.e. the code is always 5 digits or always 10 digits. Are you Customer numbers always 10 digits?
If the length is not the same for all records it cannot work as I described. This works nicely for something like an SSN that is always 9 digits.
You could make it work as a filter comparing the number converted to a string by LEFT, but that would mean it would be reading a lot of records. I use Legacy so EXIT to filter out in ValidateRecord
CUS:Number DECIMAL(10,0)
Loc:NumberLocator STRING(10)
Loc:NumberLength BYTE
ENTRY(@s10),USE(Loc:NumberLocator),IMM
!On Accepted or NewSelection calc the Length the user typed into a Len variable
Loc:NumberLength = LEN(CLIP(Loc:NumberLocator))
!Validate Record
IF Loc:NumberLength <> 0 |
AND LEFT(CUS:Number ,Loc:NumberLength) <> Loc:NumberLocator THEN EXIT. Filter Out
In that code LEFT(CUS:Number ,Loc:NumberLength) changes the numeric variable to a string then takes the left side number of digits entered in locator put in Loc:NumberLength. The affect of typing ‘3’ is the filter keeps 3, 31, 321, 312345678 which the LEFT converts all to ‘3’.
Type ‘31’ and all Cus:Number are converted to Left 2 digits so 321 is ‘32’ and gets rejected, as does 3 which '3 ’ does not equal ‘31’.
That would read all, or a lot of records, to filter out a few which is undesirable with a big file on a network. If this was SQL and that code ran server code it might be ok, ask an SQL expert how to optimize.
Hi all, as i am new to the Clarion and this group as well, this is my first post on this group. I was going through the links posted here whenever i need more info, trust me i found very useful discussions and topics most of the time. Today i was referring for the LOCATOR topic/discussion for DATE field. I couldn’t get much clarity for DATE search. I am able to introduce LOCATOR for STRING and NUMERIC fields searches but not for DATE search. Would you please help me on how to design LOCATOR for DATE field. Thanks in advance.
Locator for date would be difficult for anything except an entry field. You need to override the default and use a local variable you add to the window.