Hopefully this is a simple one, but I'm pretty stumped. Basically, I'm editing a text field of a custom object. However, it seems I get a Invalid Foreign Key Relationship error when I try and check whether the field is null:
Here's the code that throws the exception:
for(Account a: listOfAccounts{
for(object__c o: listOfObjects){
if(!o.Name.isBlank()){
o.Name.replace(a.textField__c, '');
}
}
}
Not sure why, since this works:
for(Account a: listOfAccounts{
for(object__c o: listOfObjects){
o.Name.replace(a.textField__c, '');
}
}
However, this code throws a null pointer exception if o.Name is null