Entity.toObject() with blob attributes

I was trying to create an object from an entity that contains a blob. While at a certain point in my function that seems to have worked, checking with the debugger, the object created is null outside the function.
Just to clarify, the object returned is stored in a namespace, not a webform as it should be globally available.

If I explicitly leave out the blob everything works fine.

So it is either the blob per se or it‘s a matter of size. In my case, it were about 17kB, which doesn‘t seem much.


Could you give the sample of code you are using and more details ?

I have checked the entity.toObject() function extracts the blob attributes.

I’m doing this:

exposed function pref2Object()->prefObject : object

var prefRec : cs.PreferencesEntity
var prefObject : object

prefRec = this.getRec()
prefObject = prefRec.toObject("coffeeFreq, oilFreq, sugarFreq, flourFreq, hygieneFreq")

return prefObject

If I just use toObject, the returned prefObject does contain the blob attribute in the entity, but it is null. In the entity, it has typically a size of about 10kB to 20kB.

I’m using the prefObject to display certain attributes in a webform and as a parameter to other functions, and there the blob attribute always is null.


I guess you get something like __PRIVATE_BINARY_OBJECT in your object returned by the server.

Currently, we have this isssue to return binary content.

OK, if you can reproduce, that is fine.