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 6Stefan Senegeac 6 

Can't deploy code that checks for Person integration

Hi,

I'm a newbie in SF and I'm trying to deploy some code that checks if Person integration is enabled (if it is it does some stuff, if it doesn't it does other stuff). But the compiler tells me 'Invalid field FirstName for SObject Account' which is correct but that's the point. If it has Persons activated then it has the fields FirstName and LastName on Accounts...
If I develop this code on an org which has Persons enabled and package it into an App and then an org w/o Persons enabled installs the said app will it receive an error or it will work like it's supposed to?
Thanks.
Veena Sundara-HeraguVeena Sundara-Heragu
Use the Schema.describe methods

example Schema.sObjectType.Account.fields.getMap().containsKey( 'FirstName' );