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
JasonCJasonC 

Help. Attachment cannot be resolved to a type

Hi all,

 

I am a newbie at using Java in conjuction with Salesforce, so please forgive me if I word this incorrectly and I am sure the solution is simple, but after hours of searching I cannot find it.  I am trying to attach an xlsx document to an object using some code I found on a message board as a template.  When I put the code into Eclipse at the line

 

Attachment attach = new Attachment();

 

it tells me that attachment cannot be resoved to a type.

 

What am I missing?

 

Thanks in advance.

 

JC

VirendraVirendra

Try  SObject  

 

.. i think you are using Java Client API generated using Partner wsdl like 

 

SObject docAttachment = new SObject();  

 

 docAttachment.set_any(logattachment);

 docAttachment.setType("Attachment");