2

As written here, a Lead object has a LeadSource property.

I develop a C# application to automaticaly create Leads from forms on our websites. I need to fill the LeadSource depending on the form.

My issue is : the Lead object generated from the WSDL does NOT have a property named LeadSource.

Hence my question : How do I set the LeadSource of a Lead ?

Thanks.

  • which wsdl you are referring to ? if you use enterprise wsdl, you will definitely see the LeadSource element under Lead – Vamsi Krishna Jul 15 '15 at 13:04
  • I am using the enterprise wsdl, yet definitely NOT seeing the leadsource under lead. – Paul L Jul 15 '15 at 13:07
  • Whilst not incredibly helpful, I just produced an enterprise wsdl myself and I do see a "LeadSource" element within the Lead object. I imagine I did the same as you, setup -> develop -> api -> generate enterprise wsdl - > generate. I actually found a few LeadSources (for example another under opportunity) – n34_panda Jul 15 '15 at 13:38
  • It points out the probleme is before the wsdl, not on how I use it. Entries in LeadSource were created by the CMO, using his account. I create the WSDL using the devloper account. Both have high rights on our organisation. Could it come from here ? – Paul L Jul 15 '15 at 13:40
2

It is most likely the Field-Level Security for the LeadSource field. Check that the user who is generating the Enterprise WSDL has the required access based on their profile.

You could either go to Setup > Build > Customize > Leads > Fields > Lead Source > Set Field-Level Security or /p/setup/field/StandardFieldAttributes/e?id=LeadSource&type=Lead directly on the URL.

| improve this answer | |
  • Hi, thanks for your answer. Visibility is checked for 'Systeme Admin' and 'Standard User'. The account used for WSDL generation is Sys Admin. – Paul L Jul 16 '15 at 7:46
  • @PaulL And you still can't see the LeadSource generated into the Enterprise WSDL? What do external tools based on the Partner API see for that user? Can you run a SOQL query in the developer console against LeadSource? – Daniel Ballinger Jul 16 '15 at 7:50
  • SELECT Id FROM LeadSource => sObject type 'LeadSource' is not supported. SELECT Id,LeadSource FROM Lead => No such column 'LeadSource' on entity 'Lead'. – Paul L Jul 16 '15 at 8:02
  • @PaulL By all accounts it still sounds like the Salesforce user that you are connecting with doesn't have access to that field. Can you see or add the Lead Source field to the Lead Page Layout? Maybe compare with the CMO user that you indicated could populate the LeadSource fields. – Daniel Ballinger Jul 16 '15 at 10:18
  • I generated a WSDL with the CMO's account, it appears you are right: my account didn't have sufficient rights. Still not knowing why my account isn't sys admin any more, at least I know how to solve my issue. Thanks. – Paul L Jul 16 '15 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.