Loading and sorting records based on filename

Adam 4.5 includes a new feature that isn't all that striking, but very useful nonetheless. One of the things that were a bit too difficult to accomplish with any version before 4.5, was to sort records based on the filename or to load records that match a specific filename. Previously, you had to use fields to accomplish this. Now, it can easily be done out of the box.

One of the reasons why this wasn't very straightforward is because records in ADAM don't simply have "a filename". An ADAM record can contain multiple files and each file can have multiple versions so there's no such thing as "a filename".

With 4.5, we've included a new keyword that can be used when searching for records, called LatestVersionOfMasterFile. This allows you to run a query like this:

C#
1
2
RecordCollection records = new RecordCollection(app);
records.Load(new SearchExpression("LatestVersionOfMasterFile.Filename = 'summer09.indd'"));

This loads all records for which the latest version of the master file has the specified filename. The biggest advantage of this keyword is that it can also be used when sorting. So you can also do this:

C#
1
2
RecordCollection records = new RecordCollection(app);
records.Load(new SearchExpression("hello world"), "LatestVersionOfMasterFile.Filename");

This loads all records that contain the words hello and world and sorts them on the filename of the latest version of the master file.

Comments

Thursday, 12 November 2009Alec Wadey says
Exceptionally useful - thanks for adding this one, will make all our lives easier :) Al
Leave a comment
You must be logged in to post comments.
Sign in now
 
 
CATEGORIES
AnnouncementsDocMaker StudioEngineSharePoint ConnectorWeb DevelopmentWebinarsWorkflow Studio
rss feed