8

I am getting the error

No such column 'DeveloperName' on entity 'RecordType'. 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.: Source

when saving a Lightning component on my sandbox after Summer '19 release.

The Lightning component is using an Apex class where the below code is causing the error :

Set<String> objAPINames = new Set<String>{'Account', 'Opportunity'};
Map<String,Id> mapValues = new Map<String,Id>();
for(RecordType rt : [select SobjectType, DeveloperName, Id
                     from RecordType
                     where SobjectType IN :objAPINames
                     order by SobjectType ASC ]){
    mapValues.put(rt.DeveloperName, rt.Id);
}

This code works fine in Developer Console, Apex Classes, Triggers. It is only causing error when I am saving Lightning Component calling the class.

Anyone got this issue after the new release?

  • 2
    Did you try recompiling all the classes in your org. Go to apex classes under setup and use compile all classes link. We faced something similar and got it fixed by recompiling all the classes – Ashish Sharma May 9 '19 at 15:45
  • Thank you so much @AshishSharma. It worked. I need to deploy those Lightning Components and classes to another Summer '19 sandbox and a Spring '19 production environment. The code does not exist in those org. yet. Do you think there will be similar issue while deploying? – N.. May 9 '19 at 16:01
  • 1
    I am not sure but It should not be an issue as this will be new metadata moving to target org. In case if it causes any issue, you can always deploy it in parts. First moving the classes, compile the classes/run test classes and then deploy lightning component. – Ashish Sharma May 9 '19 at 16:07
  • 1
    @AshishSharma You should add your comments as an answer as that seemed to be the resolution here. – Jayant Das May 9 '19 at 16:14
  • Ok @AshishSharma. Thank you so much for your help. I shall keep that in mind. – N.. May 9 '19 at 16:14
8

Please recompile all classes in org by using compile all classes link on apex classes page under setup or you can do runAllTest in org which will recompile the covered classes. This will fix the issue. We faced a similar issue after Summer 19 release and got it fixed by recompiling all the classes.

  • 1
    To all those having similar issue, 'Compile all classes' works. But I had to do it more than once. I did it yesterday, all was good. Today I login to continue working on my Lightning Component and I got same issue. So I had to 'Compile all classes' again. Until Salesforce applies a patch, we may need to compile all classes a few times. – N.. May 10 '19 at 10:25
  • 1
    This release is still in preview. So I am pretty sure that before GA, Salesforce will resolve this or they will not release the update which is causing this. – Ashish Sharma May 10 '19 at 11:16
  • I agree on this point, Ashish. Hoping for a fix soon though. – N.. May 10 '19 at 11:43
2

Check this Know Issue with workaround: salseforce known issue

​​​​​​Workaround Use Metadata Api or VS Code and SFDX to deploy changes to your lightning components

  • Thanks. I managed to solve the issue by recompiling all Apex Classes as suggested by Ashish. The link to the known issue is useful though. Thank you very much. – N.. May 9 '19 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.