When you are performing Dynamic Apex on an sObject and PUTTING a value on the object to modify it, the updated value is not reflected in the debugger variables.
sObject a = New Account(Name = 'Test'); a.put('Name','Updated'); System.debug(a.get('Name'));
I understand why as I do not believe the debug logs show the updated value, but can it be inferred from code or something to update the variables. Until I figured this out I was banging my head wondering why my code was not updating the values. Turns out that was not even the issue as the values were being updated.
Screenshots should be in order of:
- Construction of sObject
- Modification of the Name to Updated
- System debug
The variable in the variables window remains 'Test' until I actually Debug it. If I did not debug it then it would not be updated in the Variables window