I'm looking for the logical syntax to determine if a sobject is empty.
ACCOUNT oRecord = new ACCOUNT();
ACCOUNT oRecord1 = new ACCOUNT();
Map<Id,ACCOUNT> mCommPref = new Map<Id,ACCOUNT>();
mCommPref.put('a2r1h000000hCPMAA2', oRecord);
oRecord1 = mCommPref.get('a2r1h000000hCPMAA2');
system.debug('oRecord111 -->' + oRecord1);
system.debug('oRecord1 -->' + oRecord1 == null);
but the oRecord1 == null
return False, Need to Return as true when there is no value in the sobject. Can you help me on this
Tried by adding Empty Object as below
ACCOUNT empty = new ACCOUNT();
system.debug('oRecord1 -->' + oRecord1 == empty);
the above code getting this error
Comparison arguments must be compatible types: String, Account