Filter objects from excel

BeliasBelias Member Posts: 2,998
edited 2009-02-12 in NAV Tips & Tricks
how many times did you have an excel file with a list of object numbers and you wanted to filter them in object designer?the painful procedure to do is manually mark the objects reading them from excel...
well, with this stupid form you can copy the excel column with the values, paste it in the textbox and click the button...
the odd "crlf" characters will become beautiful "|"...then you can copy the textbox and use it as a filter in obj designer, after that, you select all and mark...what a pleasure...enjoy!
OBJECT Form 99999 Filter Maker
{
  OBJECT-PROPERTIES
  {
    Date=11/02/09;
    Time=12.16.31;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    Width=8140;
    Height=1650;
  }
  CONTROLS
  {
    { 1101327000;TextBox;220  ;220  ;5720 ;440  ;SourceExpr=TXTNumbers }
    { 1101327002;CommandButton;220;770;2200;550 ;CaptionML=ITA=Mark;
                                                 OnPush=BEGIN
                                                          CR := 13;
                                                          LF := 10;
                                                          TXTNumbers := CONVERTSTR(TXTNumbers,FORMAT(LF),'|');
                                                          TXTNumbers := DELCHR(TXTNumbers,'=',FORMAT(CR));
                                                          TXTNumbers := DELCHR(TXTNumbers,'>','|');
                                                        END;
                                                         }
  }
  CODE
  {
    VAR
      TXTNumbers@1101327000 : Text[1024];
      CR@1101327001 : Char;
      LF@1101327002 : Char;
      TBObj@1101327004 : Record 2000000001;

    BEGIN
    END.
  }
}
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Comments

  • ara3nara3n Member Posts: 9,255
    The way I do it simple and doesn't involve having any objects.

    You have the list in excel. In a column.

    21
    32
    50000



    In Excel. I copy the column. Right click in an empty cell and select Paste Special. I check Transpose and click OK.
    Then I copy the Row and paste in Notepad. In Notepad I open the replace window and paste the TAB with |
    that's it



    To copy the TAB, you just highlight the empty space in notepad.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • BeliasBelias Member Posts: 2,998
    never knew "transpose" function...good to know, thanks! 8)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ara3nara3n Member Posts: 9,255
    you're welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.