Options

Filter with part of the primary key

EMHenriquesEMHenriques Member Posts: 9
Hello,

I need to rename some items from the table item but only the first 10 positions of the field no.

They give-me the first 10 positions of the old No. and the new 10 positions.
And i have to rename all the items that i found starting with the old 10 positions.
My question is, is there a way of filtering the records with only part of the key??

The only ideia that i have is to read all the records and find those that i want. But i think that will be time consuming :?

Thanks

Eduardo
Carpe Diem

Answers

  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can filter on the first X-characters by means of '*':
    codFirst10Chars := '1234567890';
    recItem.SETFILTER("No.",codFirst10Chars + '*');
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    EMHenriquesEMHenriques Member Posts: 9
    Thanks a lot.

    I will try it now.
    Carpe Diem
  • Options
    EMHenriquesEMHenriques Member Posts: 9
    I tried, but didn't work,

    The "find", just comes empty.


    Artigos.SETFILTER(Artigos."No.", CodAnt + '*');
    IF Artigos.FIND('-') THEN REPEAT
    ..
    ..
    UNTIL Artigos.NEXT = 0;
    Carpe Diem
  • Options
    EMHenriquesEMHenriques Member Posts: 9
    Sorry, i'm an ass.

    My mistake. :oops:
    Carpe Diem
Sign In or Register to comment.