I usually do the following: find a table with a primary key of integer or code (table integer for instance), declare it as temporary, loop through the data and do an if tmprec.INSERT THEN; This leaves a temp record variable with only unique values that I can use to loop.
But I don't use it to build a text filter. When I need something similar I use either mark or (mainly) temporary records. But it's your choice from that point on.
What I suggested is a way to store the unique values. What you do with them is your choice. I don't understand grouping. If it is for a report you can select a key that starts with item no. and use group sections. If it is for a code part you can loop through the records and for each new record compare the field you want with the previous value. What are you trying to achieve exactly?
because i never use temporary table
so i create variable text = 1024
and then i can filter the table using that variable
but it is lack of length in my case...because there are double entry for filtering
so i think... if it is not double... it can be okay
it is like if you want to filter data using 200|201|202
something like that
then what's problem?
either you can insert in temp table or in text var.
REPEAT
ItemTemp."No." := "No.";
ItemTemp.SETRANGE("No.");
IF NOT FIND('-') THEN
ItemVar := ItemVar + ItemTemp."No." +'|';
UNTIL NEXT = 0;
MESSAGE('%1',ItemVar);
because you don't insert your not found record into the temporary table
REPEAT
ItemTemp."No." := "No.";
ItemTemp.SETRANGE("No.");
IF itemtemp.isempty THEN begin
ItemVar := ItemVar + ItemTemp."No." +'|';
itemtemp.insert;
end;
UNTIL NEXT = 0;
MESSAGE('%1',ItemVar);
|Pressing F1 is so much faster than opening your browser| |To-Increase|
REPEAT
ItemTemp."No." := "No.";
ItemTemp.SETRANGE("No.");
IF itemtemp.isempty THEN begin
IF ItemVar = '' THEN
ItemVar := ItemTemp."No." ELSE
ItemVar := ItemVar +'|' + ItemTemp."No.";
itemtemp.insert;
end;
UNTIL NEXT = 0;
MESSAGE('%1',ItemVar);
To avoid having to trim the last '|' .
But I strongly believe that building a filter like this should be avoided. It is very easy to get text overflow errors. If you investigate the usage of temporary tables I think you will find better solutions.
this is not the key field
i want to cacth "item no." from item ledger entry table
but i want to do grouping...
so it is not double...
I think the first step is to work out what you want. Your FIRST post should contain all the important information. If it doesn't then you just waste other peoples time when they try to help you. Try again and post EVERYTHING, if the information is confidential and top secret, then forums are not the place to ask for help.
Hi, why not using the MARK(TRUE) feature on the item table for every found Item? After the loop you can filter on only the marked ones and do what ever you want with these marked Item Records (another loop, building a filter, modifying something).
The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.
First step is to understand the need and clearly document it.
THEN try and solve it. Here again we have a business requirement turning into a code issue.
The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.
Yes David, you have made your point already. There is no need to repeat yourself.
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.
Yes David, you have made your point already. There is no need to repeat yourself.
I know. ](*,) ](*,) ](*,) ](*,) ](*,)
Maybe 3 months was not a long enough break for me to learn.
Comments
But I don't use it to build a text filter. When I need something similar I use either mark or (mainly) temporary records. But it's your choice from that point on.
Hope it helps.
i want to cacth "item no." from item ledger entry table
but i want to do grouping...
so it is not double...
so i create variable text = 1024
and then i can filter the table using that variable
but it is lack of length in my case...because there are double entry for filtering
so i think... if it is not double... it can be okay
it is like if you want to filter data using 200|201|202
something like that
crazy.....
how can u grouping until key is not defined for that field?
it is only for the filtering.....
item table = 200,201,202,203,204....
item ledger entry table = 200,201,200,200,201,203,202,203,200....
may be transaction like that
so i want filtering by group from item ledger entry table to item table
either you can insert in temp table or in text var.
REPEAT
ItemTemp."No." := "No.";
ItemTemp.SETRANGE("No.");
IF NOT FIND('-') THEN
ItemVar := ItemVar + ItemTemp."No." +'|';
UNTIL NEXT = 0;
MESSAGE('%1',ItemVar);
still double
do you know what i mistaken?
|To-Increase|
To avoid having to trim the last '|' .
But I strongly believe that building a filter like this should be avoided. It is very easy to get text overflow errors. If you investigate the usage of temporary tables I think you will find better solutions.
I think the first step is to work out what you want. Your FIRST post should contain all the important information. If it doesn't then you just waste other peoples time when they try to help you. Try again and post EVERYTHING, if the information is confidential and top secret, then forums are not the place to ask for help.
First step is to understand the need and clearly document it.
THEN try and solve it. Here again we have a business requirement turning into a code issue.
I know. ](*,) ](*,) ](*,) ](*,) ](*,)
Maybe 3 months was not a long enough break for me to learn.
:-#