cannot filter the same order no inside the same table

Hi All,

i am having issue here.

i have one page which contain lots of data, an i need to filter inside the table which is not the same as the previos one

for exmaple
Entry no. Order no Desc
1 123 abc
2 123 def
3 234 xxx
4 234 yyy

my case is that i need to change 'xxx' into 'abc'.
i have trigger something and declare a record variable (t1) of the same table that will go like this

t1.reset;
t1.setfilter("order no",'<>%1'"order no")
if t1.findfirst then
mofidy the desc

but my order no will not go to 234, it sticks to 123. can you please help me what is missing ?

thanks,

Comments

  • BT_MarcBT_Marc Member Posts: 30
    I'm not sure if i get it right what you want to do.
    You want in a Page trigger to set a filter on the Record Variable that you created that is the same table like the Source Table of the page? and if you find the Record then you want to modify a field?
  • hi @BT_Marc

    correct .
  • BT_MarcBT_Marc Member Posts: 30
    Can you post more detials?

    Table with all Fields
    Field that you want to modify and how
    Trigger you use on the Page
  • i am using custom table. i have that kind of structure data like describe above. i just can't filter the order no as '<>' as the cursor order no. seems that the ID won't "go down"

  • Peter+is1Peter+is1 Member Posts: 174
    edited 2016-06-30
    Hi,

    To modify [Desc] for 1 record, your code should look something like this... perhaps you missed something?
    Or you mean to do something else?
    t1.RESET; 
    t1.SETFILTER("Order No.", '<>%1', Rec."Order No.");
    
    IF t1.FINDFIRST THEN
    BEGIN
       IF tl.Desc <> 'abc' THEN
       BEGIN
          tl.Desc := 'abc';
          tl.MODIFY;
       END;
    END;
    
    \\
    The truth exists in seven versions.
  • BT_MarcBT_Marc Member Posts: 30
    The Code is wrong. You need to use T1.setfilter("order no",'<>%1,'"order no"); you missed one , between '<>%1' and "Order no"
Sign In or Register to comment.