Forum Discussion
Hi Angela,
Thanks for pointing this out. I was able to reproduce this in my local instance of 12.0 SP1 and SP3. It seems this is caused in the code that's responsible for building the actual HTML events in the form. When the event is built, the method code is inserted into an anonymous function with code similar to the line below:
"function() {" + the_method_code + "}";
When the final line of the method is a comment, it seems it's also commenting out that closing bracket of the anonymous function which is causing the error you're seeing.
I've filed a ticket for this issue. In the meantime, you can workaround this by either not using comments on the last line of your Field Events or by adding an extra newline to the end of your function. However, I wouldn't count this as a "design rule" exactly since this workaround only seems to be necessary for Field Events specifically. I also tested the same method code in an onLoad Form Event as well as a Client Action and both of those worked as expected.
Chris
Christopher Gillis
Aras Labs Software Engineering
- jaohol2 years agoIdeator II
FYI it appears you can used the multi-line comment /*...*/ and be OK
- angela2 years agoCatalyst II
Hi Jaohol,
thanks for the tip! I like it a lot, cause it´s more visual than using empty lines.
Does anyone know if this glitch is still a thing in the latest Innovator releases 30/31?
I am so used to use some extra lines or avoid comments at the end of the code that I never tested it out anymore.
Anyway, thanks for digging out this post from the golden era of the forum. That time was really fun!