Question

I am moving some code out of Apex to web services using the Enterprise WSDL. There is a line of code that I cannot find the equivalent to in the web service but I am hoping it is there. How would I convert this to a method from SforceService?

var client = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Business Clients').getRecordTypeId();

I am trying to do this in C# but am ok if you can help me find it in SforceService. Thanks for any help!

Était-ce utile?

La solution

Call describeSObject() on Lead. That will return a DescribeSObjectResult with an array of RecordTypeInfos. You can iterate through the RecordTypeInfos and find the one with the name you want, and get its corresponding ID there.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top