jeromecha
5 years agoCreator I
Buton code
Hello,
I wrote this very simple code in a javascript client side method :
var inn = aras.IomInnovator; alert(this.getProperty("name")); alert(this.getId()); alert("eee");
When i run this met...
Jeromecha,
The issue is this. The "this" keyword changes meanings in different contexts, and in the context of an onClick event it doesn't refer to the item. Use document.thisItem instead to point at the thing the item whose form you're on, making your code look like the following:
var inn = aras.IomInnovator;
alert(document.thisItem.getProperty("name"));
alert(document.thisItem.getId());
alert("eee");
In general, I don't trust code using the "this" keyword in different situations as it is very prone to meaning something other than what's expected. It's good to check what exactly "this" is at the time you're using it. (Also this is hard to write about without reenacting Abbot and Costello's Who's On First!) Hope that helps!
-Skyler C