How to get all fields Leads from sales forces Using api
I am using sales force wsdl, and i need to get all fields created in leads in sales forces. Are the fields in sales force are always fixed for开发者_如何学运维 can be change or renamed. please do reply.
The developer names (API names) are fixed and can't be changed. However, be aware that people can create custom fields on objects which they name themselves (the API names always end in __c for these). They can also rename those at will unless they have apex code / Visualforce pages / formula fields etc. referencing those fields.
You can do this using connector.describeSObjects("Lead"). This should return an object representing all fields in Lead. I don't know exactly how/what is returns in c#, I'm using salesforce-python-toolkit, and here is what I did:
result = h.describeSObjects('Lead')
This returned a large object describing all table relationships, an excessively large amount of info
print result[8] #This was the index for Lead fields, with name, type, etc for each
I believe result is a two-dimensional array of hashmaps, not entirely since it didn't impact what I was working on.
精彩评论