Hi
I have one text box bounded to the variable 'Search Name' of type Text.
As the user enter the text in the text box I want to filter records.
I can not get the text as the user entered into the Variable 'Search Name'
in OnInputChange Trigger.
I tried the following code to get the text
OnInputChange()
CurrForm.SAVERECORD;
RESET;
REC.SETFILTER(FieldName,SearchName+'*');
Whenever the user enter the single character that will be blocked with blue color.
To enter remaining text I need to click on the control and move the cursor to the end of text then only I can enter the text other wise it will be replaced with new character.
How to get the text entered by the user as it is in the OnIputChange() trigger.
AJAY INDIA.
Ajay
0
Comments
RIS Plus, LLC
MVP - Business Apps
could your (or others) provide a little more information: I have been asked to make the same functionality, but has problems getting back into the TextBox and let the user continue typing.
I've made the following code:
but it lets me only enter one char!
Thoms Hviid Thorn
Just move your first code to the OnAfterValidate trigger of the textbox
OnAfterValidate()
RESET;
REC.SETFILTER(FieldName,STRSUBSTNO('%1%2%3%2','@','*',SearchName));
CurrForm.UPDATE;
The @ means Ignore Case
If that still has problems then create a function on the form and call this!
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
the reason to use the OnInputChange was to get the 'Find-As-You-Type'-functionality, as known from the Find (Crtl-B in ENU language).
Below the field the information which is searched in is filtered, so you're immidiate see the result of the filter (without pressing Enter).
... as you all may guess - in Denmark its summertime, and the boss is on holiday ...
Thoms Hviid Thorn
I did not read the original post correctly!
The text is left selected after entering one value, so find as you type is not working.
Would form or control update or control activate solve it?.
currForm.UPDATE;
currForm.MyControl.UPDATE;
currForm.MyControl.ACTIVATE;
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Sorry - no, that still move focus away from the TextBox.
With no luck, I've tried to track down the uppersite SENDKEYS-method.
Guess, I've just have to wait for NAV 5 and Visual Studio ...
Thoms Hviid Thorn
One last untested Idea, Use a form with the search variable, and a sub form with a form function to filter and update the lines.
On the parent form OnInputChange call the subforms function with the SearchString, and get a customer No. returned, without updateing the parent form!
Duh!! Reverse Gear! this won't work as we need to return a record!
Back to the think tank!
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
I'm sure you can make prettier. It's based on Item record.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No, Find is not good enough - then I wouldn't have asked here!!
By now it's only a prototype, just to try if it can be done (as we want it).
Whether its going to be used or not, will also depend on other issues as performance - which I'll not make a subject here (Others may be welcome though).
- BlackTiger Do you mind sharing ?
- ara3n: That about where I/we are heading too.
Thanks for for sharing.
Thoms Hviid Thorn
OFF-TOPIC: Every IDE but C/AL got the feature of for programmers (Find-Statements-As-You-Type) - but I guess you find that stupid too :-s
As off my point of view, I stand <beaten> aside David Cox.
Thoms Hviid Thorn
Hmmm... Sad day, If we all took this view this forum would close! [-X
How many questions do we answer, when the soloution is simple, and should be covered by the reseller's training and not us?
How stupid is a trigger called OnInputChange(), where you cannot return the Input, but the help say's ?
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Nice work =D>
May I ask how you did it :?:
Thoms Hviid Thorn
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Like everyone else I can get it to filter and then it comes back to re-activating the field and not being able to continue from the last character entered.
Has anyone else had any luck with C/AL?
BlackTiger, from looking at your video it looks as if this is using "with events" like your other demo?
True? I think that the second version looks much nicer than the first. Good Job. =D>
http://www.interdynbmi.com