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
Surya Chandra Rao GandreddiSurya Chandra Rao Gandreddi 

How to query for a deleted field & update the new field in Post Install Script

I had to delete a field, say Type__c from a custom object and use RecordType ... I've deleted the field Type__c and now I'm trying to upgrade the recordTypes via PostInstallScript. But when I'm trying to query for Type__c I get the below error.

    No such column 'Type__c' on entity 'Custom Object'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Any suggestions, thanks.
Lokesh KumarLokesh Kumar
can you please share your script with us.
Surya Chandra Rao GandreddiSurya Chandra Rao Gandreddi
global without sharing class InstallCls implements InstallHandler {

  global void onInstall(InstallContext  context)  {
    List<Custom__Object> customObject = [ Select Id, Type__c From Custom__Object WHERE RecordTypeId = NULL ];
    //I've deleted Type__c and trying to update the RecortTypeId
  }

}