Report adding calculated field
replied on: Jul 19, 6:52 AM
Based on the below link
https://www.projectinsight.
I have created the same scenario for a task report.
Whenever I now go an create another New task report the customized JavaScript shows up on the new reports as well. Since this was only to be customized for a specific report is there a way that this JavaScript can be set by ID so that it should not fire on any other takes reports?
Thanks
Mario
-
Hey Mario,
I think the easiest way to do what you want would be to Save the Report and then interrogate the Saved Report Title using jQuery....
1. Save your report with a Title:
2. When you build your calculated column, just put an "if()" block around it that looks for a string of your Saved Report name:
To look for your Saved Report name, there are probably a few hundred ways to do that, depending how you're using JavaScript. Here are some off top-of-head:
Regular JavaScript:
- str.indexOf()
- str.search()
jQuery:
- :contains()
- .has()
Happy coding!
KP
0 -
Thanks Kevin
Yeah i was thinking on those lines of either using the title or the report id. the only downsize to this one would be that in case i have other tasks reports where i have customization's to be done would mean that the coding will get a bit longer and difficult to read through.
Thanks for your help.
Mario
0 -
Certainly keying on title or ID will only give you the one-off. You'd have to grab some value that was shared by all these reports...a category, type, etc. Happy coding!
0
Please sign in to leave a comment.
Comments
3 comments