Lookup last record which was added?

hi, i use a table for saving comments of articles with their date … in my form i want to show the last comment which was written … so cause of using this function in more than one form i made a flowfield in the table which should looking up the last record … but it always shows me the first record which matches … how do i get the last record filled in ? *** quack ***

Presuming that each record is date AND time stamped, AND that the stamp fields are appropriately placed in the primary key, you should be able to apply your filters, then do a FIND(’+’) to read the last record in the filtered set. Dave Studebaker das@libertyforever.com Liberty Grove Software A Navision Services Partner

No you can’t do this with flow field because you can’t create table descending key. Descending sort order is emulated only in another obj, not in table. I had such problem some time ago: http://www.navision.net/forum/topic.asp?TOPIC_ID=1113&FORUM_ID=9&CAT_ID=3&Topic_Title=Lookup+last+in+FlowField&Forum_Title=Attain%2FFinancials+%2D+Developer+Forum one of posible solutions is: In table create field (integer) and make it as primary key. Then inserting first rec assign to this field max value of integer. next fild insert with max -1. I don’t like it too, but I don’t know another way.

thx for help and the hint to look in your old replays … i think i will try it with some code … it is not so important … more a nicetohave-feature … but yeah it would be nice :slight_smile: *** quack ***

My intention was not to sort on the flowfield but to replace the “lookup” action of the flowfield with the lookup action of a FIND function, to be followed by displaying the found data. Dave Studebaker das@libertyforever.com Liberty Grove Software A Navision Services Partner