Hi,
I am using CBORM and I have a query that returns the current blog post using this syntax:
prc.post = ormService.findWhere(entityName="BlogPost", criteria={articleSlug=#rc.slug#});
I am wanting to get the “next post” after this based on the date published field. After the above line I have this line which returns all the active blog posts sorted by date published descending (including the one above).
prc.blogposts = ormService.list(entityName="BlogPost",active=1,asQuery=true, sortOrder="datePublished desc");
Maybe there is another way to go about this but I am trying to return information about the “next” post in the result set. Is there a way to do this using any native coldbox methods or maybe I should rethink how to do this altogether? I essentially want to get the current row + 1, but I am not quite sure how to do this give I am using CBORM.
Thanks in advance!