SimpleSchema's key validation issues this.field('key').value is undefined at Object.object


#1

Here is my code

avatar: {
type: String,
label: ‘Avatar’,
optional: true,
editableBy: [“member”, “admin”],
allowedValues: [‘Man’, ‘Alien’],
autoform: {
options: function () {
var getKarma = this.field(‘karma’).value;
console.log(getKarma);
if(!!getKarma > 4){
return _.map([‘Man’, ‘Alien’], function (c, i) {
return {label: c, value: c};
});
}
else {
return _.map([‘Man’], function (c, i) {
return {label: c, value: c};
});
}
}
}
}
});

I am not able to expose the field karma at all but I am able to see it and call it within my other templates (just having issues within this SimpleSchema declaration).

this.karma returns undefined and the pulldown menu will display but doesn’t validate correctly with the number

this.field(‘karma’).value which should work throws an error and doesn’t show the pulldown at all … this.karma.value also doesn’t work … anybody encountered this before ?