Please suggest me how to put attachments for a record under notes and attachments using forceTk, currently i'm using the following code and it creates attachments, but i'm not sure how to link these attachments to one of my existing records in salesforce. Do i have to update the parent.id or something of each attachment. I am using the standard code from forceTk github repo. and it's given below.
Regards,
Sangram
var client = new forcetk.Client(); var attachmentId; client.setSessionToken('{!$Api.Session_ID}'); function upload() { var file = $("#file")[0].files[0]; client.createBlob('ContentVersion', { Origin: 'C', // 'H' for Chatter File, 'C' for Content Document PathOnClient: file.name }, file.name, 'VersionData', file, function(response){ console.log(response); attachmentId = response.id; $("#message").html("Chatter File created: Take a look!"); }, function(request, status, response){ $("#message").html("Error: " + status); }); //link the attachment to a specific record }