Andreas_karl
13th July 2017, 10:10
Hi,
I made a session where assets can be planned as hired. Therefore I made a new table where a Date from - to is entered in which time period the asset is given away.
My problem is that when a new give away is planned the zoom to session should be filtered to only the assets that are available (check current date first, make a query on the custom table which assets are already taken in that period and then skip these records in the zoom session)
I really have no idea how to do that.

mark_h
13th July 2017, 14:39
You could do a query.extension(search this forum for that) on the zoom - so when you zoom to the session you find only the records where the to date is empty. Basically you build a query to limit the records to show what you want for the assets that are still available(or what you need to show on the session).

Andreas_karl
13th July 2017, 14:50
I know how to use query.extension but it's a little more complicated:
In the custom table are only assets written which are given away so I need to check that table if on a given date that asset is already planned to be given away, save it temporarly and exclude that asset from all assets (tffam100)
But I don't know how to do that

mark_h
14th July 2017, 21:27
Assuming this is a display session you can always do something in the main.table.io sections using skip.io if it is in the other table to be given away. I have done something like this in the after.read section on programs - run a quick query to check another table and if a field is set then do skip.io("").

bhushanchanda
17th July 2017, 12:02
Without knowing the table structure and the data stored in the table, it's difficult to pin point the solution. But, as Mark said, you can use query.extension in selection filter to filter the data in the zoomed session. People often write complex queries to do complex filtering. So, again, you may take a second look at the functionality and check if you can use it for your purpose.

I am assuming, you are zooming to session with main table assets(tffam100) and you need to exclude the assets which are disposed/given away on a particular date.

In this case, you might try joining the asset table to the give away table and select assets which are not given away on a particular date. I think, it can be done using selection filter. And, if not, you can try creating another table with a display session of assets. On zooming to this new session, based on the date, you can insert the assets data and it should show you only the required assets.

Andreas_karl
18th July 2017, 07:07
Thanks all for your replies. I solved it with query.extension.where and made a sub query with "not in"
That excludes all the assets which are already given away.
Thank you!