Closed avivien closed 10 years ago
A workaround is to directly set a value to _attachment instead of using setAttachment function: sObject._attachment = { filename: filename, fileName: filename, body: body };
This is a bug. I'll patch it by making the keys consistent.
Closed and released. Thanks.
Location: lib/record.js
The Record.prototype.setAttachment function and Record.prototype.getFileName are inconsistent due to case sensitivity.
Record.prototype.setAttachment = function(fileName, body) { this._attachment = { filename: fileName, body: body }; } Record.prototype.getFileName = function() { return (this._attachment) ? this._attachment.fileName : undefined; }
setAttachment use a lowercase key for filename, but getFileName try to get the value in fileName key, so the getFileName function always returns undefined.