How to get calculated attribute value script to run in browser for debugging?
I have read a number of posts and articles that say that calculated attribute scripts can be run and debugged in the browser (using Chrome or FireBug debugger tools). Even though I have added the "?debug=true" parameter and been able to set break points on the attribute script, when the script runs, it never hits any break points, and none of the "console.log" statements appear in the browser console. The only place I have been able to see any "console.log" output is on the server .log file. So I am convinced that the script is running on the server and not on the client.
I would love to be able to debug my script in the browser. How do I get it to run on the client side?
Thanks,
Robert
2 answers
For all I can tell, the calculated values run in the client, especially in the web client. You can set breakpoints and debug them. I prefer the Chrome Development tools for debugging these scripts.
Comments
showing 5 of 6
show 1 more comments
Turns out that you can only use the browser's debugger when your calculated attribute has a dependency on another attribute, and the user manually changes the value of that attribute in the UI. If you have a calculated attribute that does not depend on another field (like capturing the date of a status change), then the script only runs when the work item is saved, and it runs on the server not the client. The only way to debug this is to check the "console.log" output in the CCM.war's Eclipse log file. I'm beginning to think that any attribute calculations that depend on a status change would be better handled in a work item save post-process action.
Comments
Donald Nong
Jul 21 '16, 5:06 a.m.