function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike @ PartnersMike @ Partners 

Query for Record Type Id says No such column

I have a custom object with record types. When i try and query for the record type id it give me the error:
"Uncaught SoapFault exception: [ns1:INVALID_FIELD] INVALID_FIELD"..."No such column 'RecordTypeId' on entity 'Certification__c'"

I don't know why it started doing this all of the sudden. The script has worked great for months. Also the RecordTypeId shows up in the WSDL.

Here is the code:

////////
$query = "SELECT Id, RecordTypeId from Certification__c where Contact__c = '".$ContactID."'";
$response = $sforce->query(($query), $queryOptions);
$Info = $response->records;

if ($Info){
try {
foreach ($Info as $r) {
$r = new SObject($r);
$RecordTypeId = $r->fields->RecordTypeId;
echo $RecordTypeId."
";
}
}
}
///////

I have this happening with two different scripts looking at two different custom objects. I was thinking that there is something on my server causing this, but the other thing is i can query another information no problem.
Any help or ideas would be greatly appreciated.
Thank you,
mike
msimondsmsimonds
Did you recently upgrade your phptoolkit?

if you have, comment this line out:

//$r = new SObject($r);

The New QueryResult already does the SObject instantiation.


Hope this helps!

~Mike