function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Missing entity type information. sObject requires separate 'type' field be sent

Hi, I have a problem creating(actually cloning) attachment from a s-control. I search all the community tags/threads and there was none which can help me identify the issue. Idea is, s-control creates a copy of attachment and attach it to a specific account. But this s-control is giving an error as stated on my message subject. Please help me if someone out there has the problem solution. Here is the code
function moveAttachments() {
var desc = sforce.connection.describeSObject("Attachment"); 
var qfields = desc.toUpdateFieldNames(); var attrelList = sforce.connection.query("Select Id, " + qfields + " from Attachment where ParentId = '"+ curProsId + "' limit 1"); //delete attrelList.Id; attrelList.ParentId = masterSFDCId; //attrelList.ParentType = "Account"; attrelList.Id = null; attrelList.ContentType = "txt"; attrelList.Name = "Test" var cloneAtt = sforce.connection.create([attrelList]); }