Accessin Folder

aman_mbsaman_mbs Member Posts: 158
Dear All,

I need to access the folder through C/AL and Select the modified file from specied date range. How can i do soo
Aman Kumar Gupta

Comments

  • BeliasBelias Member Posts: 2,998
    Online help: see FILE related functions.
    If you're on 3 lvls, you'll need also DOWNLOAD and/or UPLOAD functions :wink:
    i don't understand what else you need (date, folder name...do you really need them, why?). Please explain what are you trying to achieve
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • lvanvugtlvanvugt Member Posts: 774
    Not sure if that's what you mean Mirko, but there is also a (virtual) FILE table object (2000000022) which you can use to browse through folders. Initially if you use this record type it will be empty as you need to 'go' to a directory to get the files in that directory. Code would be something like this:
    Files.SETRANGE(Path, SourceFolder);
    Files.SETFILTER(Name, '%1', '*.htm');
    Files.SETRANGE("Is a file", TRUE);
    IF Files.FIND('-') THEN
      REPEAT
        ... <write your code here>
      UNTIL Files.NEXT = 0;
    
    with SourceFolder being a string variable containing the path to the directory and Files being a record variable linked to the FILE table.

    FILE has the following attributes, i.e. fields:
      Path Is a file Name Size Date Time Data

    I think these names speak for themselves ...
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • aman_mbsaman_mbs Member Posts: 158
    Thanks buddy i guess this will help me.. Will try it... Thankyou :thumbsup:
    Aman Kumar Gupta
  • BeliasBelias Member Posts: 2,998
    Select the modified file from specied date range
    i thought that this means that he wants to open a file...i said that i didn't understood correctly this piece of post :mrgreen:
    well, aman_mbs...what did you mean? (i think that luc van vugt was right, after rereading your post :( )
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • aman_mbsaman_mbs Member Posts: 158
    Actually what i need is that i have made a program which imports the picture to item table in navision from specified folder on C drive. Now once the picture is imported and user runs the program second time i just need to re import the picture which are modified rather importing all the picture which is time consuming so for that i need to write a code in nav to select only the modified pic from the C drive.
    Aman Kumar Gupta
  • BeliasBelias Member Posts: 2,998
    :-k an advice...don't import too many pictures in NAV...your db will get bigger and bigger...you can also use a field to place the link of your images: in this way you can also avoid the bitmap format restriction and 24(?)kb size limit of navision pictures...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • aman_mbsaman_mbs Member Posts: 158
    Actaully u r rite.. But the situation is diffrent here so we need to import them.. anyways soo nice of u both guys.. u took time for me thanks
    Aman Kumar Gupta
Sign In or Register to comment.