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
Stefan Senegeac D.Stefan Senegeac D. 

Invalid field RecordTypeId for SObject Account

How can this be? I received this error for: Case, Contact, Opportunity, Lead and Account. 
I'm getting this error when I try to install my package on a dev org. With the package I'm shipping my own record types for every object that I listed above. Is this a bug? All the classes compile fine, the tests pass, packaging is ok. At install this happens...
AdamDawAdamDaw
It might be an order of operations thing. Have you tried strictly deploying the Account data first? 
Stefan Senegeac D.Stefan Senegeac D.
@AdamDaw it's a managed package so I cannot deploy on pieces. I can however make a separate package but that doesn't make sense - it should figure out that if I'm packaging record types and I'm addressing RecordTypeId field that I need record types and as such it should auto deploy them in order.
Not very elegant solution: I just made a Record Type for Account and no more errors at install but I'm guessing this is a bug on SF's part(?).