As per my understanding, the below code should throw System.SObjectException: SObject row was retrieved via SOQL without querying the requested field, but instead it updated the account phone without any exception can someone please help me to understand the same?
public static void SObjectException1() {
Account act = [SELECT ID FROM Account WHERE Name='GenePoint' LIMIT 1];
act.phone = '1234567810';
update act;
}
is it a best practice to not query the fields which we are going to update?