I think this is doable but for the life of me I cant work out the best way to do this.
I have a table that contains stocktake information per site, per week.
I would like to have a view where I can see all the sites, but only show the latest entry for them. For example some sites only submit once or twice a year, but some need to submit each week. Ideally the report would just show the latest entry but for all sites.
At first I thought I could filter it in the grid, but I cant quite get that to work, my second thought was a task the update a field to show its the latest one, but then I would need to work out how to unmark the older one also.
I think I have confused myself with it to be honest, so any help is appreciated.
Haven’t really tested this idea .. just a thought bubble.
Connect the stocktake table to itself, have a “most recent” flag in the table, default is yes. On create, use record rules to update all connected records with same site to most recent = no. Show a grid of all sites set to yes .. should only be most recent one per site.
I think this would work if i was just looking at one of the sites, then yes, this will give me that sites last stocktake. But i would like to have 1 list of all sites.
I take it back - this approach wont work. Without having played with it, I was thinking that you could filter the “update connected records” based on a form field, but now that I’ve had some time to try this out it appears that isn’t possible - the filters are absolute values only, not variables. Damn.
Now each stocktake will have a time comparison between it and the latest stocktake for that site. And assuming you don’t do more than one stocktake per minute, only one stocktake per site (the latest one) will show a result of 0 in that equation.
Then you just create your grid to display only those stocktake records where LATEST = 0, sorted however you want, and there you have it…