Quickly getting a list of filenames

Typically, to get a list of all the filenames of a specific set of records, you will load the records using RecordCollection, and then foreach through the Record objects to get the filename of the latest version of the master file of each record. Now in Adam 4.5.1, there's a quicker way to go about this. The RecordHelper class now has a GetFileNames method that allows you to do the same thing, only faster.

For example the following gets a list of all the record id's of all the JPG's sorted on filename:

C#
1
2
3
RecordHelper helper = new RecordHelper(app);
IList<KeyValuePair<Guid, string>> fileNames = helper.GetFileNames(
    new SearchExpression("Extension = jpg"), "Filename");

Then simply for each through the fileNames list and do whatever you need to do.

Comments

Leave a comment
You must be logged in to post comments.
Sign in now
 
 
Technical
Business
rss feed