0

I am not able to attach excel(.xls) file in "notes and attachments" section in the specific record in Salesforce using c#. I am a beginner in salesforce. I will appreciate any kind of help. Thank you in advance.

Here's the code:

const string qry = "SELECT ID, Name FROM Contact";
var result = await forceClient.QueryAsync<Contact>(qry);
byte[] inbuff = File.ReadAllBytes(@"file");
dynamic attach = new ExpandoObject();
attach.Body = inbuff;
attach.Name = "Test5" + ".xls";
attach.IsPrivate = false;
var createResults = await forceClient.CreateAsync("Contact", attach);

I am getting this type of error:

"No such column 'Body' on sobject of type Contact

1
  • 1
    forceClient.CreateAsync("Attachment", attach); use attachment instead of contact Aug 12, 2016 at 9:42

1 Answer 1

0

You need to update this line

forceClient.CreateAsync("Attachment", attach);

use attachment instead of contact

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .