salesforcedevartdotconnect

Text value of the picklist field. Salesforce, Dotconnect, Devart


I am using Devart DotConnect to access Salesforce database. And there is a problem accessing field that is a picklist. Here is part of my Enterprise.wdsl:

<element name="RecordType" nillable="true" minOccurs="0" type="ens:RecordType"/>
<element name="RecordTypeId" nillable="true" minOccurs="0" type="tns:ID"/>

I can do

SELECT RecordTypeId ...

and get 18-digit ID, but if I do

SELECT RecordType ...

I get "Unknown column" error

In Apex I can do

RecordType.Name

But in DotConnect it doesn't work. Is there a way to build a query to extract RecordType text value? I know one workaround is to create a formula field and select that. But I'd prefer not to change existing Salesforce schema.

Thanks!


Solution

  • It appears I need to join RecordType table

    SELECT f.Boo, rt.Name as RecordType
    FROM Foo f
    JOIN RecordType rt on f.RecordTypeId=rt.Id
    

    Interestingly Salesforce documentation on RecordType object doesn't show Id column but this join works and returns expected values