Custom Columns - VF and Single Run of a section
Posted: 01 Jan 2016 13:55
Happy New XYear
1. Is it possible to set a Visual Filter on Custom Scripted Column
2. As the scripts for custom column, run per file, how do you run a section of code only once. My scripted column pulls data from a file for that folder (intended to do once - cache it) and then works out values for individual files from that cached. I tried two methods, and don't like them much
a. Time Difference - If the code was run within the previous 60 seconds, don't run that global piece of code. Otherwise run that piece of code and update the previous run time. (Thanks to TheQwerty)
b. Folder Path - Set a perm variable to the current folder path. If the path is different run the global code and update the perm var.
I hate method a, because it is difficult to identify, if it is working on stale cache (cache was for a different folder)
Method b is disliked, because I need to unset the variable if the contents of the files are changed or else it continues to work on a stale cache.
Obvious solution would be try a combination of both, but it would almost double the time for script execution and hence cancelled out.
Do you have some other tricks in your sleeves.
1. Is it possible to set a Visual Filter on Custom Scripted Column
2. As the scripts for custom column, run per file, how do you run a section of code only once. My scripted column pulls data from a file for that folder (intended to do once - cache it) and then works out values for individual files from that cached. I tried two methods, and don't like them much
a. Time Difference - If the code was run within the previous 60 seconds, don't run that global piece of code. Otherwise run that piece of code and update the previous run time. (Thanks to TheQwerty)
b. Folder Path - Set a perm variable to the current folder path. If the path is different run the global code and update the perm var.
I hate method a, because it is difficult to identify, if it is working on stale cache (cache was for a different folder)
Method b is disliked, because I need to unset the variable if the contents of the files are changed or else it continues to work on a stale cache.
Obvious solution would be try a combination of both, but it would almost double the time for script execution and hence cancelled out.
Do you have some other tricks in your sleeves.