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
URVASHIURVASHI 

Bulk api example in C#.net

Hello,

        I need bulk api code in C#.net.The developer guide gives the code for client java application.I need it for C#.net.or can i convert the same code to C#.I tried it using IKVM,buit couldnot do it successfully.Please help.

URVASHIURVASHI

Hey thanks for the reply.

But i wana convert the bulk api sample client application which is in java(given in bulk api developer guide) to dotnet C#.Has anyone done that.If yes please provide the code along with the jar files converted to dll files.

Ashish_SFDCAshish_SFDC

Hi Urvashi, 

 

The bulk API is rest-based, so all you need to do is write C# code that can send and receive HTTP requests to our servers.  

 

See the links below, 

 

http://boards.developerforce.com/t5/NET-Development/Bulk-API-Sample-app-using-C/td-p/210918

https://github.com/ServiceStack/ServiceStack/wiki/C%23-client

 

 

Regards,

Ashish

URVASHIURVASHI

Hey Ashish thanks a lot for all the links. :)

 

Dhaval PanchalDhaval Panchal
Will you please share sample code for C#-Salesforce integration using BULK Api?
Luke J FreelandLuke J Freeland
Hey Guys. I recently had to use the Bulk API using C# so I started the Salesforce Bulk API Starter GitHub Project (https://github.com/lfreeland/Salesforce-Bulk-API-Starter) to allow others to do the same. The project contains a test project which demonstrates how to Query, Insert, Upsert, and Delete using the framework.

The project can also be downloaded from Nuget using Install-Package SFBulkAPIStarter. 
SidharthSidharth
Has anybody figured out good C# code samples leveraging SF Bulk API ? If yes, can you share. Thanks in advance.
Gerald GeorgeGerald George
I want to post form fields from my web page into salesforce via web to lead and also in my local database. Can anyone show me how to do this with .Net mvc c# ? I have common fields like user name,email,phone etc
Please look at my code here

<script type="text/javascript">
function submitPractice() {
webToLead({
oid: '00D20000000l2qZ'
//,debug:1
//, debugEmail: 'gerald@ghanafx.com'
, first_name: $("#PracticeUserDetail_FirstName").val()
, last_name: $("#PracticeUserDetail_LastName").val()
, email: $("#Email").val()
, country_code: $("#PracticeUserDetail_Country").val()
, lead_source: 'web demo'
, description: 'This is an automated transparent lead'
});

//practiceform
var formData = JSON.stringify($("#practiceform").serializeArray());
$.ajax({
type: "POST",
url: "/Account/Practice",
data: formData,
success: function () { },
dataType: "json",
contentType: "application/json"
});

}
function webToLead(fields) {
var customHiddenIframeName='JLA_API';
if(!document.getElementById(customHiddenIframeName)){
var theiFrame=document.createElement("iframe");
theiFrame.id=customHiddenIframeName;
theiFrame.name=customHiddenIframeName;
theiFrame.src='about:blank';
theiFrame.style.display='none';
document.body.appendChild(theiFrame);
}
fields['retURL'] = 'http://166.62.127.6/';//dummy URL
var form = document.createElement("form");
form.method = "POST";
form.action = "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8";
form.setAttribute("target", customHiddenIframeName);
for (var fieldName in fields) {
var theInput = document.createElement("input");
theInput.name=fieldName;
theInput.value=fields[fieldName];
theInput.setAttribute("type", "hidden");
form.appendChild(theInput);
}
document.body.appendChild(form);
form.submit();
}
</script>