Mod: Partitioning Resources
Posted: Wed Mar 23, 2011 8:36 am
Overview.
If you have large numbers of resources (rooms, people, trucks, etc.) you may find scrolling through them less than ideal.
Jason Young has written a nice mod where you can partition your resources into groups, showing only the resources relevant to the task at hand. This is something you can easily add your own SeedCode deployment.
Movie.
See this in action here: http://www.youtube.com/watch?v=ORLOnqfsgLA
The Mod.
1. Back up your file. (seriously)
2. Set up multiple Value Lists to represent your different groups:
ResourceGroup1
ResourceGroup2
etc.
You'll probably also want one called "all resources" that contains the names of all your resources.
3. Create another new value list made up of the names of the above value lists. We'll call it ValueLists:
ResourceGroup1
ResourceGroup2
etc,
4. Create a new global field in the table CalendarInterface called ValueList. Place that field on the Calendar Layout where you can get to it from the Schedule and Grid views (sidebar?). Make the field a drop-down and assign the value list ValueLists to it. This will tell the script which Resource value list you want to load.
5. Go into the script: "Load Resources" the first script step is assigning the variable $sc_Resources with the following calculation:
ValueListItems ( Get ( FileName ) ; "Resources" )
Change this to
ValueListItems ( Get ( FileName ) ; CalendarInterface::ValueList )
This tells the script which group you have selected.
6. Edit the script "Refresh Calendar { UseExistingData ; DontRefresh }" and call the script "Load Resources" at the very beginning of this script.
That's it!
You'll probably want to set up a default value for CalendarInterface::ValueList, otherwise you'll get the default resources if it's empty. You can set it during the "Upon Opening" script.
You'll also need to hit the refresh button when you change Value Lists / Resource Groups, or...to be fancy you could put an "On Object Modify" script trigger on your drop down and have it run the script: "Refresh Calendar { UseExistingData ; DontRefresh }"
Enjoy!
If you have large numbers of resources (rooms, people, trucks, etc.) you may find scrolling through them less than ideal.
Jason Young has written a nice mod where you can partition your resources into groups, showing only the resources relevant to the task at hand. This is something you can easily add your own SeedCode deployment.
Movie.
See this in action here: http://www.youtube.com/watch?v=ORLOnqfsgLA
The Mod.
1. Back up your file. (seriously)
2. Set up multiple Value Lists to represent your different groups:
ResourceGroup1
ResourceGroup2
etc.
You'll probably also want one called "all resources" that contains the names of all your resources.
3. Create another new value list made up of the names of the above value lists. We'll call it ValueLists:
ResourceGroup1
ResourceGroup2
etc,
4. Create a new global field in the table CalendarInterface called ValueList. Place that field on the Calendar Layout where you can get to it from the Schedule and Grid views (sidebar?). Make the field a drop-down and assign the value list ValueLists to it. This will tell the script which Resource value list you want to load.
5. Go into the script: "Load Resources" the first script step is assigning the variable $sc_Resources with the following calculation:
ValueListItems ( Get ( FileName ) ; "Resources" )
Change this to
ValueListItems ( Get ( FileName ) ; CalendarInterface::ValueList )
This tells the script which group you have selected.
6. Edit the script "Refresh Calendar { UseExistingData ; DontRefresh }" and call the script "Load Resources" at the very beginning of this script.
That's it!
You'll probably want to set up a default value for CalendarInterface::ValueList, otherwise you'll get the default resources if it's empty. You can set it during the "Upon Opening" script.
You'll also need to hit the refresh button when you change Value Lists / Resource Groups, or...to be fancy you could put an "On Object Modify" script trigger on your drop down and have it run the script: "Refresh Calendar { UseExistingData ; DontRefresh }"
Enjoy!