Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- .NET Development
- :
- Add attachment for new contact in c#
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Add attachment for new contact in c#
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-20-2012 06:12 AM
Hi,
We need to add an attachment for new contact. We are creating using APEX class for adding new contact. We are able create new contact. we need to maintain the Order information for a contact. This is not possible with the available fields/custom fields. So we are going to try with attachment. a customer may have multiple orders.
Can you please let me know how to add attachment for a contact using c#.
Please find the below code snippet:
Contact newContact = new Contact();
newContact.LastName = downloadInformation.Name;
newContact.Email = downloadInformation.Email;
try
{
SforceService salesForce = new SforceService();
MySFServiceService mySFServive = new MySFServiceService();
mySFServive.SessionHeaderValue = new SForce.MyService.SessionHeader();
LoginResult loginResult = salesForce.login("id", "password");
mySFServive.SessionHeaderValue.sessionId = loginResult.sessionId;
// UserRegistration is a method defined in our apex class.
// parametter 1: contact object parameter
// 2: account name
mySFServive.UserRegistration(newContact, "Test Account");
catch (Exception ex)
{
}

