0
votes

I have a C# project I'm trying to implement an automatic integration for the forms to map and send data automatically to Salesforce. For example let's say I have a form with some fields in it and I want the value of the fields that their names match the names of the fields in Lead entity be sent to salesforce and create a lead. For this I can manually create a lead using partner wsdl, But in order to be able to implement automatic mapping between Salesforce Lead entity fields and my form fields I need to fetch the name of the fields from Salesforce.

By the time I have the name of the fields of the Lead entity, I will check whether those field names exist in the form and grab the value from form fields and shape a payload and send it to salesforce.

Any idea how is it possible to get the field names of a specific Salesforce entity(Lead, Contact, Task etc) using Partner WSDL?

Thank you in advance,

1

1 Answers

2
votes

You have to call describeSObjects method to get object property.

DescribeSObjectResult[] describeSObjectResults = 
                        binding.describeSObjects(
                        new string[] { "account", "contact", "lead" }); 

Object api name will be passed in array as parameter. Please use this url to get sample code. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects.htm

Let me know if this solves your query.