hi all
usually when we want to filter using '*'
but how to do that in CAL code?
let say we have vendor name : microsoftdynamics
but i just have parameter micro
how to filter using first 5 characters?
thanks
VendTable.SETFILTER(VendTable."Search Name",'%1%2',VendName,'*');
-->failed
Answers
KCP Consultores
failed also
my complete code
Should be
COPYSTR(VendName,1,5)
http://www.BiloBeauty.com
http://www.autismspeaks.org
KCP Consultores
Do you want a TEXTBOX where you enter 5 characters & then it filters?
Do you want to click on a name and it takes "that" name - get's the first 5 characters and then filters for others with the same starting 5?
Not sure what your final goal is? :-k
http://www.BiloBeauty.com
http://www.autismspeaks.org
KCP Consultores
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
KCP Consultores
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Note for the OP (julkifli33) - next time give your code sample along with the question, as your question was somewhat misleading as to the issue. Also any error message you received such as "No vendor found in the filter '%1%2'". You will get your answers sooner.
KCP Consultores
because i want to import for 3rd party
even the same vendor, but i think its better if i search from the first 5 characters
because this 3rd party dont have vendor id
i use this code or
the error message as i attach
activate debugger and check..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
it works
use this code
thanks
Guys, what's wrong on using the SETFILTER correctly? Filter in second parameter, values, in rest... do not forget that 3rd, 4th... parameters are strongly typed based on the field type. Second parameter is there to create filter with placeholders for values. I know, that there are sometime problems with the placeholders not replaced with the values, but it is just exceptional behavior and could be solved in exceptional way.
Sorry for this offtopic post, but I can't resist...
(same for MESSAGE(FORMAT(something)) instead MESSAGE('%1',something))
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.