is it even possible to save attachment with remote objects to salesforce?
I tried this:
- construct remote object model
<apex:remoteObjects jsNamespace="MyModel">
<apex:remoteObjectModel name="Attachment" fields="Name,Id,ParentId,Body" >
</apex:remoteObjectModel>
</apex:remoteObjects>
- create attachment
var blob='test body';
var ctDetails = {Name:'test',parentid:'some_id',Body:blob};
var ct = new MyModel.Attachment();
ct.create(ctDetails);
I get response:
Body: value not of required type...
I thought problem has to be with body encoding and I tried to convert to base64 (btoa('test body')), use Blob class in javascript. Nothing works, response is the same everytime.
What is wrong here?
Attachment
via remote objects and then examine the encoding of the body? This may indicate how you should encode the body, assuming symmetric treatment for retrieval and creation.Visualforce Remoting Exception: No serializer found for class common.udd.object.EncryptableFfxBlobField$DeferredEncryptableFfxBlobValueImpl
If I try to retrieve attachment without body field, it works normally.