Whenever an assignment is done, Panorama checks to see if the record needs to be locked before the value is done. Unfortunately, the code confused if a variable has the same name as a database field.
This check is being performed in the AssignStatement.m:destinationIsField method. This method does have code to check if the destination is a variable, but apparently this code doesn’t work.
Ok, a clue – it DOES work ok if I use let p = 2. So perhaps the problem is that the variable value isn’t defined yet. Or maybe when let is used the check isn’t done?
This was found by a user that had a field named p, then his next New Generation failed because of a local variable named p in the SetDictionaryValue statement (which was called by the UploadToServer procedure).