Error when trying to implement a Default Value script
Accepted answer
Comments
Hi Donald
Glenn, you really have to work on your coding skills, I'm sorry to say. It takes much more time to figure out what's wrong with your code than write my own version. Here is a list of the errors that I can spot, so far.
1. Suspicious use of ParseFloat() function (why?).
2. Incorrect use of workitem.getLabel() - it should be getValue() if you want to use Ids.
3. Incorrect use of "===" (it means the object type has to match as well).
4. Extra semicolon (;) at the end of each "if" condition - syntax error!
5. Fail to return a value for a function (missing "else").
You first need to learn how to debug your code in a browser. Then start with the code skeleton (use the "fill in example" feature), and add your own code bit by bit. Verify that the code works at each step that you add more code.